Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Aug 26, 2023
1 parent c8b1276 commit e8b7ecf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/pytests/unit/test_minion.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def test_send_req_fires_completion_event(event, minion_opts):
if "fire_event" in call[0]:
condition_event_tag = (
len(call.args) > 1
and call.args[1] == "__master_req_channel_payload"
and call.args[1]
== f"__master_req_channel_payload/{minion_opts['master']}"
)
condition_event_tag_error = "{} != {}; Call(number={}): {}".format(
idx, call, call.args[1], "__master_req_channel_payload"
Expand Down Expand Up @@ -709,9 +710,11 @@ def compile_pillar(self):

try:
with patch("salt.pillar.get_pillar", return_value=MockPillarCompiler()):
with patch("salt.loader.executors") as execmock:
with patch("salt.loader.executors", mock=MagicMock()) as execmock:
minion.gen_modules()
assert execmock.called_with(minion.opts, minion.functions)
execmock.assert_called_once_with(
minion.opts, functions=minion.functions, proxy=minion.proxy, context={}
)
finally:
minion.destroy()

Expand Down

0 comments on commit e8b7ecf

Please sign in to comment.