Fixup the unit.client_test.LocalClientTestCase.test_cmd_subset from #35720

Refs #35720
This commit is contained in:
rallytime 2016-08-24 17:39:57 -06:00
parent 7877ff1d5e
commit a671f0a092

View File

@ -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)
try:
cmd_cli_mock.assert_called_with(['minion2'], 'first.func', (), progress=False,
kwarg=None, expr_form='list',
ret='')
except AssertionError:
cmd_cli_mock.assert_called_with(['minion1'], 'first.func', (), progress=False,
kwarg=None, expr_form='list',
ret=['first.func', 'second.func'])
ret='')
self.client.cmd_subset('*', 'first.func', sub=10, cli=True)
try:
cmd_cli_mock.assert_called_with(['minion2', 'minion1'], 'first.func', (), progress=False,
kwarg=None, expr_form='list',
ret='')
except AssertionError:
cmd_cli_mock.assert_called_with(['minion1', 'minion2'], 'first.func', (), progress=False,
kwarg=None, expr_form='list',
ret=['first.func', 'second.func'])
ret='')
@skipIf(NOT_ZMQ, 'This test only works with ZeroMQ')
def test_pub(self):