import os import argparse from converter import create_junit_test_file, write_junit_file parser = argparse.ArgumentParser(description='Test File') parser.add_argument('test_suite_name', type=str, help='Class of tests to parse') args = parser.parse_args() OUTPUT_FILE = 'output.xml' TESTS_FILE = os.environ['TEST_RESULTS'] if __name__ == "__main__": tests = create_junit_test_file(TESTS_FILE) write_junit_file(OUTPUT_FILE,tests,args.test_suite_name)
def test_not_failure_1(): t = create_junit_test_file("test_results_2.txt") assertpy.assert_that(len(t)).is_equal_to(19) for test in t: assertpy.assert_that(test.is_failure()).is_none()
def test_count_single_file_2(): t = create_junit_test_file("test_results_1.txt\ntest_results_2.txt") assertpy.assert_that(len(t)).is_equal_to(29)
def test_assert_status_2(): t = create_junit_test_file("test_results_2.txt") for test in t: assertpy.assert_that(test.status).is_equal_to("Passed")