Beispiel #1
0
class TestCaseTest(TestCase):
    def setUp(self):
        self.test = WasRun("testMethod")
    def testRunning(self, result):
        self.test.run()
        assert(self.test.wasRun)
    def testSetUp(self):
        self.test.run()
        assert(self.test.wasSetUp)
        assert("setUp testMethod " == self.test.log)
    def testTemplateMethod(self):
        test = WasRun("testMethod")
        test.run(result)
        assert("setUp testMethod tearDown " == test.log)
        print "setUp testMethod tearDown " == test.log
    def testResult(self):
        test = WasRun("testMethod")
        result = test.run();
        assert("1 run, 0 failed" == result.summary())
        print "1 run, 0 failed" == result.summary()
    def testFailedResult(self):
        test = WasRun("testBrokenMethod")
        result = test.run(result);
        assert("1 run, 1 failed" == result.summary())
Beispiel #2
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     result = test.run(result);
     assert("1 run, 1 failed" == result.summary())
Beispiel #3
0
 def testResult(self):
     test = WasRun("testMethod")
     result = test.run();
     assert("1 run, 0 failed" == result.summary())
     print "1 run, 0 failed" == result.summary()
Beispiel #4
0
 def testTemplateMethod(self):
     test = WasRun("testMethod")
     test.run(result)
     assert("setUp testMethod tearDown " == test.log)
     print "setUp testMethod tearDown " == test.log
Beispiel #5
0
 def setUp(self):
     self.test = WasRun("testMethod")
Beispiel #6
0
import WasRun

test = WasRun.WasRun("testMethod")
print(test.wasRun)
test.run()
print(test.wasRun)
Beispiel #7
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())
Beispiel #8
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     test.run(self.result)
     assert ("1 run, 1 failed" == self.result.summary())
Beispiel #9
0
 def testResult(self):
     test = WasRun("testMethod")
     test.run(self.result)
     assert ("1 run, 0 failed" == self.result.summary())
Beispiel #10
0
 def testTemplateMethod(self):
     test = WasRun("testMethod")
     test.run(self.result)
     assert ("setUp testMethod tearDown " == test.log)