(Fixed API tests form correct results file.
* All testsuites output valid result and append it into
results file instead of replacing it every time;
* All test suites are contained in the <testsuite> tag inside
<testsuites> parent.
@@ -11,21 +11,18 @@ from trigger_test import TriggerTest
from pyinfraboxutils.storage import storage
-
if __name__ == '__main__':
storage.create_buckets()
with open('results.xml', 'wb') as output:
+ suite = unittest.TestSuite()
#unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output))
- project_test_suite = unittest.TestLoader().loadTestsFromTestCase(ProjectTest)
- trigger_test_suite = unittest.TestLoader().loadTestsFromTestCase(TriggerTest)
- job_api_test_suite = unittest.TestLoader().loadTestsFromTestCase(JobApiTest)
- build_test_suite = unittest.TestLoader().loadTestsFromTestCase(BuildTest)
- job_test_suite = unittest.TestLoader().loadTestsFromTestCase(JobTest)
-
- runner = XMLTestRunner(output=output)
- runner.run(project_test_suite)
- runner.run(trigger_test_suite)
- runner.run(job_api_test_suite)
- runner.run(build_test_suite)
- runner.run(job_test_suite)
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(ProjectTest))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TriggerTest))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(JobApiTest))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BuildTest))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(JobTest))
+
+ unittest.main(testRunner = XMLTestRunner(output=output),
+ failfast=False, buffer=False, catchbreak=False)
+ testRunner.run(suite)
