Add test case to conform parser errors on wrong arguments

This commit is contained in:
Pedro Algarvio 2013-12-31 09:32:04 +00:00
parent aaf0261107
commit 7e62178d5a

View file

@ -22,7 +22,18 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
_call_binary_ = 'salt-key'
def test_list(self):
def test_list_accepted_args(self):
'''
test salt-key -l for accepted arguments
'''
for key in ('acc', 'pre', 'un', 'rej'):
# These should not trigger any error
data = self.run_key('-l {0}'.format(key), catch_stderr=True)
self.assertNotIn('error:', '\n'.join(data[1]))
data = self.run_key('-l foo-{0}'.format(key), catch_stderr=True)
self.assertIn('error:', '\n'.join(data[1]))
def test_list_all(self):
'''
test salt-key -L
'''