Skip to content

Commit

Permalink
Mock blocking connect_pub method
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Dec 28, 2023
1 parent a5d377d commit 62774c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/pytests/unit/modules/test_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ def test_purge(job1):
patch_schedule_get_event = patch.object(
SaltEvent, "get_event", return_value={"complete": True, "schedule": {}}
)
patch_schedule_connect_pub = patch.object(
SaltEvent, "connect_pub", return_value=True
)
patch_schedule_list = patch.object(
schedule, "list_", MagicMock(return_value=_schedule_data)
)

with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_list:
with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_connect_pub, patch_schedule_list:
assert schedule.purge() == {
"comment": ["Deleted job: job1 from schedule."],
"changes": {"job1": "removed"},
Expand Down

0 comments on commit 62774c3

Please sign in to comment.