Пример #1
0
	def test_should_update_test_on_skip(self):
		watcher = Watcher()
		update_test = mock_on(watcher)._update_test

		skippy = mock('skippy')
		update_test.is_expected.once().with_(skippy.raw, test_result.skip)
		watcher.beforeTest(skippy.raw)
		watcher.afterTest(skippy.raw)
Пример #2
0
    def test_should_update_test_on_skip(self):
        watcher = Watcher()
        update_test = mock_on(watcher)._update_test

        skippy = mock('skippy')
        update_test.is_expected.once().with_(skippy.raw, test_result.skip)
        watcher.beforeTest(skippy.raw)
        watcher.afterTest(skippy.raw)
Пример #3
0
	def test_should_update_test_on_success(self):
		watcher = Watcher()
		update_test = mock_on(watcher)._update_test

		good = mock('good')
		
		update_test.is_expected.once().with_(good.raw, test_result.success)
		watcher.beforeTest(good.raw)
		watcher.addSuccess(good.raw)
Пример #4
0
    def test_should_update_test_on_success(self):
        watcher = Watcher()
        update_test = mock_on(watcher)._update_test

        good = mock('good')

        update_test.is_expected.once().with_(good.raw, test_result.success)
        watcher.beforeTest(good.raw)
        watcher.addSuccess(good.raw)
Пример #5
0
	def test_should_update_test_on_error(self):
		watcher = Watcher()
		update_test = mock_on(watcher)._update_test

		ugly = mock('ugly').with_children(plugins=mock('ugly plugins').with_methods(formatError=None).raw)
		ugly_err = mock('ugly_err')
		update_test.is_expected.once().with_(ugly.raw, test_result.error, ugly_err.raw)

		watcher.beforeTest(ugly.raw)
		watcher.handleError(ugly.raw, ugly_err.raw)
Пример #6
0
	def test_should_update_test_on_failure(self):
		watcher = Watcher()
		update_test = mock_on(watcher)._update_test

		bad = mock('bad').with_children(plugins=mock('bad plugins').with_methods(formatFailure=None).raw)
		bad_err = mock('bad_err')

		update_test.is_expected.once().with_(bad.raw, test_result.fail, bad_err.raw)

		watcher.beforeTest(bad.raw)
		watcher.handleFailure(bad.raw, bad_err.raw)
Пример #7
0
    def test_should_update_test_on_error(self):
        watcher = Watcher()
        update_test = mock_on(watcher)._update_test

        ugly = mock('ugly').with_children(
            plugins=mock('ugly plugins').with_methods(formatError=None).raw)
        ugly_err = mock('ugly_err')
        update_test.is_expected.once().with_(ugly.raw, test_result.error,
                                             ugly_err.raw)

        watcher.beforeTest(ugly.raw)
        watcher.handleError(ugly.raw, ugly_err.raw)
Пример #8
0
    def test_should_update_test_on_failure(self):
        watcher = Watcher()
        update_test = mock_on(watcher)._update_test

        bad = mock('bad').with_children(
            plugins=mock('bad plugins').with_methods(formatFailure=None).raw)
        bad_err = mock('bad_err')

        update_test.is_expected.once().with_(bad.raw, test_result.fail,
                                             bad_err.raw)

        watcher.beforeTest(bad.raw)
        watcher.handleFailure(bad.raw, bad_err.raw)