support/testing: add python-colorzero test
authorPeter Seiderer <ps.report@gmx.net>
Sat, 13 Jun 2020 19:20:32 +0000 (21:20 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 18 Jun 2020 19:45:00 +0000 (21:45 +0200)
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
.gitlab-ci.yml
support/testing/tests/package/sample_python_colorzero.py [new file with mode: 0644]
support/testing/tests/package/test_python_colorzero.py [new file with mode: 0644]

index 951f843cf2cc3ca25f9fa4c2764f1f4d8c757471..3bad5d5ae9f20c27859be288c6438368eda04deb 100644 (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 }
diff --git a/support/testing/tests/package/sample_python_colorzero.py b/support/testing/tests/package/sample_python_colorzero.py
new file mode 100644 (file)
index 0000000..23862a8
--- /dev/null
@@ -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))
diff --git a/support/testing/tests/package/test_python_colorzero.py b/support/testing/tests/package/test_python_colorzero.py
new file mode 100644 (file)
index 0000000..b7c228a
--- /dev/null
@@ -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