def testSuite(self): suite = TestSuite() suite.add(WasRun("testMethod")) suite.add(WasRun("testBrokenMethod")) suite.run(self.result) assert "2 run, 1 failed, WasRun.testBrokenMethod-Exception" == self.result.summary( )
def testSuite(self): suite = TestSuite() suite.add(WasRun("testMethod")) suite.add(WasRun("testBrokenMethod")) result = TestResult() suite.run(result) assert ("2 run, 1 failed" == result.summary)
def testSuite(self): suite = TestSuite() suite.add(WasRun("testTemplateMethod")) suite.add(WasRun("testFailedResult")) suite.add(WasRun("testResult")) result = suite.run() assert ("3 run, 1 failed" == result.summary())
def testRunning(self): test= WasRun("testMethod") assert(not test.wasRun) test.run() assert(test.wasRun) TestCaseTest("testRunning").run()
def testTestSuite(self): suite = TestSuite() suite.add(WasRun("testMethod")) suite.add(WasRun("testBrokenMethod")) result = TestResult() suite.run(result) print "???" assert result.summary() == "2 run, 1 failed"
class TestCaseTest(TestCase): def setUp(self): self.test = WasRun("testMethod") def testSetUp(self): self.test.run() assert "setUasdp " == self.test.log def testRunning(self): self.test.run() assert self.test.wasRun
class TestCaseTest(TestCase): def setup(self): self.result = TestResult() def test_template_method(self): self.test = WasRun("test_method") self.test.run(self.result) assert ("setup test_method tear_down " == self.test.log) def test_result(self): self.test = WasRun("test_method") self.test.run(self.result) assert ("1 run, 0 failed" == self.result.summary()) def test_failed_result(self): self.test = WasRun("test_broken_method") self.test.run(self.result) assert ("1 run, 1 failed" == self.result.summary()) def test_failed_result_formatting(self): self.result.test_started() self.result.test_failed() assert ("1 run, 1 failed" == self.result.summary()) def test_if_tear_down_runs_regardless(self): self.test = WasRun("test_broken_method") self.test.run(self.result) assert ("setup tear_down " == self.test.log) def test_suite(self): suite = TestSuite() suite.add(WasRun("test_method")) suite.add(WasRun("test_broken_method")) suite.run(self.result) assert ("2 run, 1 failed" == self.result.summary())
def testSetUpErrorsReport(self): suite = TestSuite() suite.add(WasRun("testMethod")) suite.add(SetUpError("testMethod", ZeroDivisionError)) suite.add(SetUpError("testBrokenMethod", ValueError)) suite.run(self.result) assert "3 run, 2 failed, SetUpError.testMethod-ZeroDivisionError, SetUpError.testBrokenMethod-ValueError" == \ self.result.summary()
def testRunning(self): test = WasRun("testMethod") assert (not test.wasRun) test.run() assert (test.wasRun)
def testResult(self): test = WasRun("testMethod") result = test.run() assert ("1 run, 0 fail" == result.summary())
def testResult(self): test = WasRun('testMethod') result = test.run() assert ('1 run, 0 failed' == result.summary())
from WasRun import WasRun from TestCase import TestCase test = WasRun("testMethod") print test.wasRun test.run() print test.wasRun
def test_template_method(self): test = WasRun("test_method") test.run(self.result) assert ("SetUp test_method tear_down " == test.log)
def testTemplateMethod(self): test = WasRun('testMethod') test.run() assert ('setUp testMethod tearDown ' == test.log)
def testFailedResult(self): test = WasRun('testBrokenMethod') test.run(self.result) assert('1 run, 1 failed' == self.result.summary())
def testResult(self): test=WasRun("testMethod") test.run(self.result) assert("1 run, 0 failed" == self.result.summary())
def testTemplateMethod(self): test = WasRun("testMethod") test.run(self.result) assert("setUp testMethod tearDown " == test.log)
def testTemplateMethod(self): test = WasRun('testMethod') test.run(self.result) assert('setUp testMethod tearDown ' == test.log)
def testFailedResult(self): test = WasRun("testBrokenMethod") result = test.run() assert("1 run, 1 fail" == result.summary())
def testFailedResultFormatting(self): self.result.testStarted() self.result.testFailed(WasRun("testMethod"), Exception()) assert "1 run, 1 failed, WasRun.testMethod-Exception" == self.result.summary( )
def testFailedResult(self): test = WasRun("testBrokenMethod") test.run(self.result) assert "1 run, 1 failed, WasRun.testBrokenMethod-Exception" == self.result.summary( )
def testFailedResult(self): test = WasRun("testBrokenMethod") result = test.run() assert ("1 run, 1 fail" == result.summary())
def testResult(self): test = WasRun("testMethod") result = test.run() assert("1 run, 0 fail" == result.summary())
def testFailedResult(self): test = WasRun('testBrokenMethod') result = test.run() assert ('1 run, 1 failed' == result.summary())
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 test_failed_result(self): test = WasRun("") test.run(self.result) assert ("1 run, 1 failed" == self.result.summary())
def testSetUp(self): test = WasRun("testMethod") test.run(self.result) assert ("setUp testMethod " == test.log)
def test_template_method(self): self.test = WasRun("test_method") self.test.run(self.result) assert ("setup test_method tear_down " == self.test.log)
def testResult(self): test = WasRun('testMethod') test.run(self.result) assert('1 run, 0 failed' == self.result.summary())
def test_failed_result(self): self.test = WasRun("test_broken_method") self.test.run(self.result) assert ("1 run, 1 failed" == self.result.summary())
def __init__(self, name, e=Exception()): self._e = e WasRun.__init__(self, name)
def test_if_tear_down_runs_regardless(self): self.test = WasRun("test_broken_method") self.test.run(self.result) assert ("setup tear_down " == self.test.log)
def testTemplateMethod(self): test = WasRun("testMethod") test.run(self.result) assert ("setUp testMethod tearDown " == test.log)
def test_suite(self): suite = TestSuite() suite.add(WasRun("test_method")) suite.add(WasRun("test_broken_method")) suite.run(self.result) assert ("2 run, 1 failed" == self.result.summary())
def testFailedResult(self): test = WasRun("testBrokenMethod") test.run(self.result) assert ("1 run, 1 failed" == self.result.summary())
from WasRun import WasRun test = WasRun("testMethod") print test.wasRun test.run() print test.wasRun
def setUp(self): self.test = WasRun("testMethod")
def __init__(self, name): WasRun.__init__(self, name)