Exemple #1
0
    def testSuite(self):
        suite = TestSuite()
        suite.add(WasRun("testMethod"))
        suite.add(WasRun("testBrokenMethod"))
        suite.run(self.result)

        assert ("2 run, 1 failed" == result.summary())
Exemple #2
0
    def testRunning(self):
        test = WasRun("testMethod")

        assert (not test.wasRun)

        test.run()

        assert (test.wasRun)
Exemple #3
0
class TestCaseTest(TestCase):
    def setUp(self):
        self.test = WasRun("testMethod")

    def testRunning(self):
        self.test.run()

        assert (self.test.wasRun)

    def testSetUp(self):
        self.test.run()

        assert (self.test.wasSetUp)
Exemple #4
0
 def testTemplateMethod(self):
     test = WasRun("testMethod")
     test.run()
     
     assert("setUp testMethod tearDown" == self.test.log)
Exemple #5
0
 def setUp(self):
     self.test = WasRun("testMethod")
 def testFailedResultWithTearDown(self):
     test = WasRun('testBrokenMethod')
     result = test.run(self.result)
     self.assertEquals(result.summary(), '1 run, 1 failed')
     self.assertEquals('setUp testBrokenMethod tearDown ', test.log)
 def testFailedResult(self):
     test = WasRun('testBrokenMethod')
     result = test.run(self.result)
     self.assertEquals(result.summary(), '1 run, 1 failed')
 def testResult(self):
     test = WasRun('testMethod')
     result = test.run(self.result)
     self.assertEquals(result.summary(), '1 run, 0 failed')
 def testTemplateMethod(self):
     test = WasRun('testMethod')
     test.run(self.result)
     self.assertTrue(test.wasRun)
     self.assertEquals('setUp testMethod tearDown ', test.log)
Exemple #10
0
    def testFailedResult(self):
        test = WasRun("testBrokenMethod")
        result = test.run()

        assert ("1 run, 1 failed" == result.summary())
Exemple #11
0
    def testResult(self):
        test = WasRun("testMethod")
        result = test.run()

        assert ("1 run, 0 failed" == result.summary())
 def test_running(self):
     test = WasRun('test_method')
     assert (not test.was_run)
     test.run()
     assert (test.was_run)