mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Mock blocking connect_pub method
This commit is contained in:
parent
a5d377db70
commit
62774c3234
1 changed files with 4 additions and 1 deletions
|
@ -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"},
|
||||
|
|
Loading…
Add table
Reference in a new issue