Exemplo n.º 1
0
 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(
     )
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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())
Exemplo n.º 4
0
 def testRunning(self):
     test= WasRun("testMethod")
     assert(not test.wasRun)
     
     test.run()
     assert(test.wasRun)
     
     TestCaseTest("testRunning").run()
Exemplo n.º 5
0
 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"
Exemplo n.º 6
0
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
Exemplo n.º 7
0
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())
Exemplo n.º 8
0
 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()
Exemplo n.º 9
0
 def testRunning(self):
     test = WasRun("testMethod")
     assert (not test.wasRun)
     test.run()
     assert (test.wasRun)
Exemplo n.º 10
0
 def testResult(self):
     test = WasRun("testMethod")
     result = test.run()
     assert ("1 run, 0 fail" == result.summary())
Exemplo n.º 11
0
 def testResult(self):
     test = WasRun('testMethod')
     result = test.run()
     assert ('1 run, 0 failed' == result.summary())
Exemplo n.º 12
0
from WasRun import WasRun
from TestCase import TestCase
test = WasRun("testMethod")
print test.wasRun
test.run()
print test.wasRun
Exemplo n.º 13
0
 def test_template_method(self):
     test = WasRun("test_method")
     test.run(self.result)
     assert ("SetUp test_method tear_down " == test.log)
Exemplo n.º 14
0
 def testTemplateMethod(self):
     test = WasRun('testMethod')
     test.run()
     assert ('setUp testMethod tearDown ' == test.log)
Exemplo n.º 15
0
	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)
Exemplo n.º 18
0
	def testTemplateMethod(self):
		test = WasRun('testMethod')
		test.run(self.result)
		assert('setUp testMethod tearDown ' == test.log)
Exemplo n.º 19
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     result = test.run()
     assert("1 run, 1 fail" == result.summary())
Exemplo n.º 20
0
 def testFailedResultFormatting(self):
     self.result.testStarted()
     self.result.testFailed(WasRun("testMethod"), Exception())
     assert "1 run, 1 failed, WasRun.testMethod-Exception" == self.result.summary(
     )
Exemplo n.º 21
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     test.run(self.result)
     assert "1 run, 1 failed, WasRun.testBrokenMethod-Exception" == self.result.summary(
     )
Exemplo n.º 22
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     result = test.run()
     assert ("1 run, 1 fail" == result.summary())
Exemplo n.º 23
0
 def testResult(self):
     test = WasRun("testMethod")
     result = test.run()
     assert("1 run, 0 fail" == result.summary())
Exemplo n.º 24
0
 def testFailedResult(self):
     test = WasRun('testBrokenMethod')
     result = test.run()
     assert ('1 run, 1 failed' == result.summary())
Exemplo n.º 25
0
 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())
Exemplo n.º 27
0
 def test_failed_result(self):
     test = WasRun("")
     test.run(self.result)
     assert ("1 run, 1 failed" == self.result.summary())
Exemplo n.º 28
0
    def testSetUp(self):
        test = WasRun("testMethod")

        test.run(self.result)

        assert ("setUp testMethod " == test.log)
Exemplo n.º 29
0
 def test_template_method(self):
     self.test = WasRun("test_method")
     self.test.run(self.result)
     assert ("setup test_method tear_down " == self.test.log)
Exemplo n.º 30
0
	def testResult(self):
		test = WasRun('testMethod')
		test.run(self.result)
		assert('1 run, 0 failed' == self.result.summary())
Exemplo n.º 31
0
 def test_failed_result(self):
     self.test = WasRun("test_broken_method")
     self.test.run(self.result)
     assert ("1 run, 1 failed" == self.result.summary())
Exemplo n.º 32
0
 def __init__(self, name, e=Exception()):
     self._e = e
     WasRun.__init__(self, name)
Exemplo n.º 33
0
 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)
Exemplo n.º 34
0
 def testTemplateMethod(self):
     test = WasRun("testMethod")
     test.run(self.result)
     assert ("setUp testMethod tearDown " == test.log)
Exemplo n.º 35
0
 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())
Exemplo n.º 36
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     test.run(self.result)
     assert ("1 run, 1 failed" == self.result.summary())
Exemplo n.º 37
0
from WasRun import WasRun

test = WasRun("testMethod")
print test.wasRun
test.run()
print test.wasRun
Exemplo n.º 38
0
 def setUp(self):
     self.test = WasRun("testMethod")
	def __init__(self, name):
		WasRun.__init__(self, name)