示例#1
0
 def testSuite(self):
   suite = TestSuite()
   suite.add(WasRun("testMethod"))
   suite.add(WasRun("testBrokenMethod"))
   suite.run(self.result)
   assert("2 run, 1 failed" == self.result.summary())
示例#2
0
    assert("setUp testMethod tearDown " == test.log)
  def testResult(self):
    test = WasRun("testMethod")
    test.run(self.result)
    assert("1 run, 0 failed" == self.result.summary())
  def testFailedResult(self):
    test = 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 = TestSuite()
    suite.add(WasRun("testMethod"))
    suite.add(WasRun("testBrokenMethod"))
    suite.run(self.result)
    assert("2 run, 1 failed" == self.result.summary())

suite = TestSuite()
suite.add( TestCaseTest("testTemplateMethod") )
suite.add( TestCaseTest("testResult") )
suite.add( TestCaseTest("testFailedResultFormatting") )
suite.add( TestCaseTest("testFailedResult") )
suite.add( TestCaseTest("testSuite") )
result = TestResult()
suite.run(result)
print result.summary()