Esempio n. 1
0
    def test_tests_per_second(self):
        test_result = TestResult()
        for x in range(20):
            test_result.startTest('rainbow', (1, 1, x, 1))

        test_result.start_time = TIME1
        test_result.stop_time = TIME2
        self.assertTrue(0.16 < test_result.tests_per_second() < 0.17)
Esempio n. 2
0
    def test_tests_per_second(self):
        test_result = TestResult()
        for x in range(20):
            test_result.startTest('rainbow', (1, 1, x, 1))

        test_result.start_time = TIME1
        test_result.stop_time = TIME2
        self.assertTrue(0.16 < test_result.tests_per_second() < 0.17)
Esempio n. 3
0
    def test_test_success_rate_is_correct(self):
        test_result = TestResult()

        loads_status = (1, 1, 1, 1)
        test_result.startTest('bacon', loads_status)
        test_result.addSuccess('bacon', loads_status)
        test_result.addFailure('bacon', 'A failure', loads_status)

        self.assertEquals(0.5, test_result.test_success_rate())
Esempio n. 4
0
    def test_test_success_rate_is_correct(self):
        test_result = TestResult()

        loads_status = (1, 1, 1, 1)
        test_result.startTest('bacon', loads_status)
        test_result.addSuccess('bacon', loads_status)
        test_result.addFailure('bacon', 'A failure', loads_status)

        self.assertEquals(0.5, test_result.test_success_rate())