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(
     )
Exemple #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)
Exemple #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())
Exemple #4
0
 def testRunning(self):
     test= WasRun("testMethod")
     assert(not test.wasRun)
     
     test.run()
     assert(test.wasRun)
     
     TestCaseTest("testRunning").run()
Exemple #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"
Exemple #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
Exemple #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())
 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)
Exemple #10
0
 def testResult(self):
     test = WasRun("testMethod")
     result = test.run()
     assert ("1 run, 0 fail" == result.summary())
Exemple #11
0
 def testResult(self):
     test = WasRun('testMethod')
     result = test.run()
     assert ('1 run, 0 failed' == result.summary())
Exemple #12
0
from WasRun import WasRun
from TestCase import TestCase
test = WasRun("testMethod")
print test.wasRun
test.run()
print test.wasRun
Exemple #13
0
 def test_template_method(self):
     test = WasRun("test_method")
     test.run(self.result)
     assert ("SetUp test_method tear_down " == test.log)
Exemple #14
0
 def testTemplateMethod(self):
     test = WasRun('testMethod')
     test.run()
     assert ('setUp testMethod tearDown ' == test.log)
Exemple #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)
Exemple #18
0
	def testTemplateMethod(self):
		test = WasRun('testMethod')
		test.run(self.result)
		assert('setUp testMethod tearDown ' == test.log)
Exemple #19
0
 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(
     )
Exemple #22
0
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     result = test.run()
     assert ("1 run, 1 fail" == result.summary())
Exemple #23
0
 def testResult(self):
     test = WasRun("testMethod")
     result = test.run()
     assert("1 run, 0 fail" == result.summary())
Exemple #24
0
 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())
Exemple #27
0
 def test_failed_result(self):
     test = WasRun("")
     test.run(self.result)
     assert ("1 run, 1 failed" == self.result.summary())
Exemple #28
0
    def testSetUp(self):
        test = WasRun("testMethod")

        test.run(self.result)

        assert ("setUp testMethod " == test.log)
Exemple #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)
Exemple #30
0
	def testResult(self):
		test = WasRun('testMethod')
		test.run(self.result)
		assert('1 run, 0 failed' == self.result.summary())
Exemple #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())
 def __init__(self, name, e=Exception()):
     self._e = e
     WasRun.__init__(self, name)
Exemple #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)
 def testTemplateMethod(self):
     test = WasRun("testMethod")
     test.run(self.result)
     assert ("setUp testMethod tearDown " == test.log)
Exemple #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())
 def testFailedResult(self):
     test = WasRun("testBrokenMethod")
     test.run(self.result)
     assert ("1 run, 1 failed" == self.result.summary())
Exemple #37
0
from WasRun import WasRun

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