test_python_treq.py 678 B

123456789101112131415161718192021
  1. from tests.package.test_python import TestPythonPackageBase
  2. class TestPythonTreq(TestPythonPackageBase):
  3. sample_scripts = ["tests/package/sample_python_treq.py"]
  4. def run_sample_scripts(self):
  5. cmd = self.interpreter + " sample_python_treq.py"
  6. output, exit_code = self.emulator.run(cmd, timeout=20)
  7. refuse_msgs = [1 for line in output if "Connection refused" in line]
  8. self.assertGreater(sum(refuse_msgs), 0)
  9. self.assertEqual(exit_code, 0)
  10. class TestPythonPy3Treq(TestPythonTreq):
  11. __test__ = True
  12. config = TestPythonTreq.config + \
  13. """
  14. BR2_PACKAGE_PYTHON3=y
  15. BR2_PACKAGE_PYTHON_TREQ=y
  16. """