Пример #1
0
 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())
Пример #2
0
        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()
Пример #3
0
 def getTestResultXml(self, testname):
     return xunit.TestSuite().fromUnity(self.testResult,
                                        name=testname,
                                        time=self.testTime,
                                        hostname=self.server)