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

        test.run(self.result)

        assert ("setUp testMethod " == test.log)
Пример #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)
Пример #30
0
	def testResult(self):
		test = WasRun('testMethod')
		test.run(self.result)
		assert('1 run, 0 failed' == self.result.summary())
Пример #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())
Пример #32
0
 def __init__(self, name, e=Exception()):
     self._e = e
     WasRun.__init__(self, name)
Пример #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)
Пример #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())
Пример #37
0
from WasRun import WasRun

test = WasRun("testMethod")
print test.wasRun
test.run()
print test.wasRun
Пример #38
0
 def setUp(self):
     self.test = WasRun("testMethod")
	def __init__(self, name):
		WasRun.__init__(self, name)