Commit b959e8ce b959e8ce5ae1fce2dbb50be30ac86e5fbea039c6 by Nicolas Perriault

added clitest for XUnit report generation

1 parent 38d27611
...@@ -408,5 +408,30 @@ class TestCommandOutputTest(CasperExecTestBase): ...@@ -408,5 +408,30 @@ class TestCommandOutputTest(CasperExecTestBase):
408 ], failing=True) 408 ], failing=True)
409 409
410 410
411 class XUnitReportTest(CasperExecTestBase):
412 XUNIT_LOG = os.path.join(TEST_ROOT, '__log.xml')
413
414 def setUp(self):
415 self.clean()
416
417 def tearDown(self):
418 self.clean()
419
420 def clean(self):
421 if os.path.exists(self.XUNIT_LOG):
422 os.remove(self.XUNIT_LOG)
423
424 def test_xunit_report_passing(self):
425 script_path = os.path.join(TEST_ROOT, 'tester', 'passing.js')
426 command = 'test %s --xunit=%s' % (script_path, self.XUNIT_LOG)
427 self.runCommand(command, failing=False)
428 self.assertTrue(os.path.exists(self.XUNIT_LOG))
429
430 def test_xunit_report_failing(self):
431 script_path = os.path.join(TEST_ROOT, 'tester', 'failing.js')
432 command = 'test %s --xunit=%s' % (script_path, self.XUNIT_LOG)
433 self.runCommand(command, failing=True)
434 self.assertTrue(os.path.exists(self.XUNIT_LOG))
435
411 if __name__ == '__main__': 436 if __name__ == '__main__':
412 unittest.main() 437 unittest.main()
......