test_python_gpiozero.py 892 B

1234567891011121314151617181920212223242526272829303132
  1. from tests.package.test_python import TestPythonPackageBase
  2. class TestPythonGpiozero(TestPythonPackageBase):
  3. config = TestPythonPackageBase.config
  4. sample_scripts = ["tests/package/sample_python_gpiozero.py"]
  5. def run_sample_scripts(self):
  6. cmd = self.interpreter + " sample_python_gpiozero.py"
  7. output, exit_code = self.emulator.run(cmd)
  8. self.assertEqual(exit_code, 0)
  9. cmd = "pinout -r a020d3 -m | cat"
  10. self.assertRunOk(cmd)
  11. class TestPythonPy2Gpiozero(TestPythonGpiozero):
  12. __test__ = True
  13. config = TestPythonPackageBase.config + \
  14. """
  15. BR2_PACKAGE_PYTHON=y
  16. BR2_PACKAGE_PYTHON_GPIOZERO=y
  17. """
  18. class TestPythonPy3Gpiozero(TestPythonGpiozero):
  19. __test__ = True
  20. config = TestPythonGpiozero.config + \
  21. """
  22. BR2_PACKAGE_PYTHON3=y
  23. BR2_PACKAGE_PYTHON_GPIOZERO=y
  24. """