test_python_treq.py 1016 B

1234567891011121314151617181920212223242526272829
  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. # Need to use a different toolchain than the default due to
  13. # python-cryptography using Rust (not available with uclibc)
  14. config = \
  15. """
  16. BR2_arm=y
  17. BR2_TOOLCHAIN_EXTERNAL=y
  18. BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
  19. BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_STABLE=y
  20. BR2_PACKAGE_PYTHON3=y
  21. BR2_PACKAGE_PYTHON_TREQ=y
  22. BR2_TARGET_ROOTFS_CPIO=y
  23. # BR2_TARGET_ROOTFS_TAR is not set
  24. """