def test_call_positive(self): """Test call obj positive result.""" obj = Task() obj.setup = mock.Mock() obj.execute = mock.Mock() obj.teardown = mock.Mock() obj()
def test_call_exception_while_executing(self, debug_mock): """Test call obj exception raised while executing.""" obj = Task() obj.setup = mock.Mock() obj.execute = _raise_exception obj.teardown = mock.Mock() obj() debug_mock.assert_called_once()
def test_call_exception_while_executing(self): """Test call obj exception raised while executing.""" obj = Task() with mock.patch.object(obj.logger, "debug") as debug_mock: obj.setup = mock.Mock() obj.execute = _raise_exception obj.teardown = mock.Mock() obj() debug_mock.assert_called_once()