From a671f0a09275332a198cbc0f59b6f8a222e5be4d Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 24 Aug 2016 17:39:57 -0600 Subject: [PATCH] Fixup the unit.client_test.LocalClientTestCase.test_cmd_subset from #35720 Refs #35720 --- tests/unit/client_test.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/unit/client_test.py b/tests/unit/client_test.py index f5b69b45d4..f0cfff1f90 100644 --- a/tests/unit/client_test.py +++ b/tests/unit/client_test.py @@ -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):