test_python_uvloop.py 658 B

12345678910111213141516171819202122
  1. import os
  2. from tests.package.test_python import TestPythonPackageBase
  3. class TestPythonPy3Uvloop(TestPythonPackageBase):
  4. __test__ = True
  5. config = TestPythonPackageBase.config + \
  6. """
  7. BR2_PACKAGE_PYTHON3=y
  8. BR2_PACKAGE_PYTHON_UVLOOP=y
  9. """
  10. sample_scripts = ["tests/package/sample_python_uvloop.py"]
  11. def test_run(self):
  12. self.login()
  13. self.check_sample_scripts_exist()
  14. cmd = "%s %s" % (self.interpreter, os.path.basename(self.sample_scripts[0]))
  15. output, exit_code = self.emulator.run(cmd)
  16. self.assertEqual(exit_code, 0)
  17. self.assertEqual(output[0], "Hello world!")