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