cook: always mock notify_agents in tests (#72335)

This commit is contained in:
Benjamin Dauvergne 2022-12-15 14:22:06 +01:00
parent 12b1b5096b
commit 50ef55637d
1 changed files with 6 additions and 1 deletions

View File

@ -26,6 +26,12 @@ from hobo.environment.models import (
from hobo.profile.models import AttributeDefinition
@pytest.fixture(autouse=True)
def mocked_notify_agents():
with patch('hobo.environment.management.commands.cook.notify_agents') as mocked_notify_agents:
yield mocked_notify_agents
def test_check_action(monkeypatch):
"""no exception raised if url are available"""
command = Command()
@ -89,7 +95,6 @@ def test_handle():
assert command.run_cook.mock_calls == [call('recipe.json')]
@patch('hobo.environment.management.commands.cook.notify_agents')
def test_run_cook(mocked_notify_agents, tmpdir):
command = Command()
command.permissive = False