def testSuite(self): suite = xunit.TestSuite() suite.add(xunit.WasRun("testMethod")) suite.add(xunit.WasRun("testBrokenMethod")) result = xunit.TestResult() suite.run(result) assert ("2 run, 1 failed" == result.summary())
assert ("1 run, 0 failed" == self.result.summary()) def testFailedResult(self): test = xunit.WasRun("testBrokenMethod") test.run(self.result) assert ("1 run, 1 failed" == self.result.summary()) def testFailedResultFormatting(self): self.result.testStarted() self.result.testFailed() assert ("1 run, 1 failed" == self.result.summary()) def testSuite(self): suite = xunit.TestSuite() suite.add(xunit.WasRun("testMethod")) suite.add(xunit.WasRun("testBrokenMethod")) result = xunit.TestResult() suite.run(result) assert ("2 run, 1 failed" == result.summary()) suite = xunit.TestSuite() suite.add(TestCaseTest("testTemplateMethod")) suite.add(TestCaseTest("testResult")) suite.add(TestCaseTest("testFailedResult")) suite.add(TestCaseTest("testFailedResultFormatting")) suite.add(TestCaseTest("testSuite")) result = xunit.TestResult() suite.run(result) print result.summary()
def getTestResultXml(self, testname): return xunit.TestSuite().fromUnity(self.testResult, name=testname, time=self.testTime, hostname=self.server)