mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't assume again and expand test.
* When introducing the "Don't assume!" changes I also assumed that there were always more than one argument from the shell. Expanded the testcase to include this check.
This commit is contained in:
parent
75f70e49f3
commit
527cf4ee38
2 changed files with 6 additions and 1 deletions
|
@ -730,7 +730,7 @@ class SaltCMDOptionParser(OptionParser, ConfigDirMixIn, TimeoutMixIn,
|
|||
# Include the target
|
||||
if self.args[0] != '*':
|
||||
self.args.insert(0, '*')
|
||||
if self.args[1] != 'sys.doc':
|
||||
if len(self.args) < 2 or self.args[1] != 'sys.doc':
|
||||
# Include the function
|
||||
self.args.insert(1, 'sys.doc')
|
||||
|
||||
|
|
|
@ -154,10 +154,15 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
'''
|
||||
Test to see if we're not auto-adding '*' and 'sys.doc' to the call
|
||||
'''
|
||||
data = self.run_salt('\'*\' -d')
|
||||
self.assertIn('user.add:', data)
|
||||
data = self.run_salt('\'*\' -d user.add')
|
||||
self.assertIn('user.add:', data)
|
||||
data = self.run_salt('\'*\' sys.doc -d user.add')
|
||||
self.assertIn('user.add:', data)
|
||||
data = self.run_salt('\'*\' sys.doc user.add')
|
||||
self.assertIn('user.add:', data)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Reference in a new issue