mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add LocalClient.cmd test for arg/kwarg parsing
This commit is contained in:
parent
fceaaf41d0
commit
854e098aa0
1 changed files with 22 additions and 1 deletions
|
@ -6,7 +6,6 @@ from __future__ import absolute_import
|
|||
# Import Salt Testing libs
|
||||
from tests.support.case import ModuleCase
|
||||
|
||||
|
||||
class StdTest(ModuleCase):
|
||||
'''
|
||||
Test standard client calls
|
||||
|
@ -94,3 +93,25 @@ class StdTest(ModuleCase):
|
|||
ret = self.client.cmd('minion', 'test.ping', full_return=True)
|
||||
for mid, data in ret.items():
|
||||
self.assertIn('retcode', data)
|
||||
|
||||
def test_cmd_arg_kwarg_parsing(self):
|
||||
ret = self.client.cmd('minion', 'test.arg_clean',
|
||||
arg=[
|
||||
'foo',
|
||||
'bar=off',
|
||||
'baz={qux: 123}'
|
||||
],
|
||||
kwarg={
|
||||
'quux': 'Quux',
|
||||
})
|
||||
|
||||
self.assertEqual(ret['minion'], {
|
||||
'args': ['foo'],
|
||||
'kwargs': {
|
||||
'bar': False,
|
||||
'baz': {
|
||||
'qux': 123,
|
||||
},
|
||||
'quux': 'Quux',
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue