support/testing: add python-colorzero test

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Peter Seiderer 2020-06-13 21:20:32 +02:00 committed by Thomas Petazzoni
parent 185398f619
commit dc5761beb0
3 changed files with 33 additions and 0 deletions

View File

@ -481,6 +481,8 @@ tests.package.test_python_cbor.TestPythonPy2Cbor: { extends: .runtime_test }
tests.package.test_python_cbor.TestPythonPy3Cbor: { extends: .runtime_test }
tests.package.test_python_click.TestPythonPy2Click: { extends: .runtime_test }
tests.package.test_python_click.TestPythonPy3Click: { extends: .runtime_test }
tests.package.test_python_colorzero.TestPythonPy2Colorzero: { extends: .runtime_test }
tests.package.test_python_colorzero.TestPythonPy3Colorzero: { extends: .runtime_test }
tests.package.test_python_constantly.TestPythonPy2Constantly: { extends: .runtime_test }
tests.package.test_python_constantly.TestPythonPy3Constantly: { extends: .runtime_test }
tests.package.test_python_crossbar.TestPythonPy3Crossbar: { extends: .runtime_test }

View File

@ -0,0 +1,8 @@
from colorzero import Color
red = Color('red')
green = Color('lime')
blue = Color('blue')
assert(red.rgb == (1.0, 0.0, 0.0))
assert(green.rgb == (0.0, 1.0, 0.0))
assert(blue.rgb == (0.0, 0.0, 1.0))

View File

@ -0,0 +1,23 @@
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy2Colorzero(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_COLORZERO=y
"""
sample_scripts = ["tests/package/sample_python_colorzero.py"]
timeout = 30
class TestPythonPy3Colorzero(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_COLORZERO=y
"""
sample_scripts = ["tests/package/sample_python_colorzero.py"]
timeout = 30