Esempio n. 1
0
    def test_auto_starts_the_recorder(self):
        # Mock a pytest request object
        request = mock.MagicMock()
        request.cls = request.module = None
        request.function.__name__ = 'test'

        pytest_fixture.betamax_recorder(request)
        self.mocked_betamax.start.assert_called_once_with()
Esempio n. 2
0
    def test_auto_starts_the_recorder(self):
        # Mock a pytest request object
        request = mock.MagicMock()
        request.cls = request.module = None
        request.function.__name__ = 'test'

        pytest_fixture.betamax_recorder(request)
        self.mocked_betamax.start.assert_called_once_with()
Esempio n. 3
0
    def test_adds_stop_as_a_finalizer(self):
        # Mock a pytest request object
        request = mock.MagicMock()
        request.cls = request.module = None
        request.function.__name__ = 'test'

        pytest_fixture.betamax_recorder(request)
        assert request.addfinalizer.called is True
        request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop)
Esempio n. 4
0
    def test_adds_stop_as_a_finalizer(self):
        # Mock a pytest request object
        request = mock.MagicMock()
        request.cls = request.module = None
        request.function.__name__ = 'test'

        pytest_fixture.betamax_recorder(request)
        assert request.addfinalizer.called is True
        request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop)