def test_directory_with_failure(self): os.mkdir(self.reports) bad_xml = GOOD_XML.replace('errors="0"', 'errors="1"') with open(os.path.join(self.reports, 'foo.xml'), 'w') as fp: fp.write(bad_xml) with self.assertRaises(SystemExit): junit_report.main()
def test_directory_with_failure_and_some_other_flake(self): with open(os.path.join(self.flakes, 'my.test'), 'w') as fp: fp.write("Heeeeere's Johnny!") os.mkdir(self.reports) bad_xml = GOOD_XML.replace('errors="0"', 'errors="1"') with open(os.path.join(self.reports, 'foo.xml'), 'w') as fp: fp.write(bad_xml) with self.assertRaises(SystemExit): junit_report.main()
def test_empty_directory(self): os.mkdir(self.reports) with self.assertRaises(SystemExit): junit_report.main()
def test_directory_with_success(self): os.mkdir(self.reports) with open(os.path.join(self.reports, 'foo.xml'), 'w') as fp: fp.write(GOOD_XML) with self.assertRaises(SystemExit): junit_report.main()
def test_no_directory(self): with self.assertRaises(SystemExit): junit_report.main()