mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixup the unit.client_test.LocalClientTestCase.test_cmd_subset from #35720
Refs #35720
This commit is contained in:
parent
7877ff1d5e
commit
a671f0a092
1 changed files with 15 additions and 6 deletions
|
@ -53,17 +53,26 @@ class LocalClientTestCase(TestCase,
|
|||
|
||||
@patch('salt.client.LocalClient.cmd', return_value={'minion1': ['first.func', 'second.func'],
|
||||
'minion2': ['first.func', 'second.func']})
|
||||
def test_cmd_subset(self, cmd_mock):
|
||||
def test_cmd_subset(self):
|
||||
with patch('salt.client.LocalClient.cmd_cli') as cmd_cli_mock:
|
||||
self.client.cmd_subset('*', 'first.func', sub=1, cli=True)
|
||||
cmd_cli_mock.assert_called_with(['minion1'], 'first.func', (), progress=False,
|
||||
try:
|
||||
cmd_cli_mock.assert_called_with(['minion2'], 'first.func', (), progress=False,
|
||||
kwarg=None, expr_form='list',
|
||||
ret=['first.func', 'second.func'])
|
||||
|
||||
ret='')
|
||||
except AssertionError:
|
||||
cmd_cli_mock.assert_called_with(['minion1'], 'first.func', (), progress=False,
|
||||
kwarg=None, expr_form='list',
|
||||
ret='')
|
||||
self.client.cmd_subset('*', 'first.func', sub=10, cli=True)
|
||||
cmd_cli_mock.assert_called_with(['minion1', 'minion2'], 'first.func', (), progress=False,
|
||||
try:
|
||||
cmd_cli_mock.assert_called_with(['minion2', 'minion1'], 'first.func', (), progress=False,
|
||||
kwarg=None, expr_form='list',
|
||||
ret=['first.func', 'second.func'])
|
||||
ret='')
|
||||
except AssertionError:
|
||||
cmd_cli_mock.assert_called_with(['minion1', 'minion2'], 'first.func', (), progress=False,
|
||||
kwarg=None, expr_form='list',
|
||||
ret='')
|
||||
|
||||
@skipIf(NOT_ZMQ, 'This test only works with ZeroMQ')
|
||||
def test_pub(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue