xref: /OK3568_Linux_fs/buildroot/support/testing/tests/package/test_python_unittest_xml_reporting.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1from tests.package.test_python import TestPythonPackageBase
2import os
3
4
5class TestPythonPy3UnitTestXmlReporting(TestPythonPackageBase):
6    __test__ = True
7    config = TestPythonPackageBase.config + \
8        """
9        BR2_PACKAGE_PYTHON3=y
10        BR2_PACKAGE_PYTHON_UNITTEST_XML_REPORTING=y
11        """
12    sample_scripts = ["tests/package/sample_python_unittest_xml_reporting.py"]
13    timeout = 60
14
15    def test_run(self):
16        self.login()
17        self.check_sample_scripts_exist()
18        cmd = "%s %s" % (self.interpreter, os.path.basename(self.sample_scripts[0]))
19        self.assertRunOk(cmd)
20        # check if some tests results in XML were generated
21        cmd = "ls -1 test-reports/TEST-Test1-*.xml"
22        self.assertRunOk(cmd)
23