mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix buggy test
This commit is contained in:
parent
11568af6f5
commit
686c45b8ab
1 changed files with 10 additions and 4 deletions
|
@ -73,9 +73,15 @@ class ModuleStateTest(TestCase, LoaderModuleMockMixin):
|
|||
keywords=None,
|
||||
defaults=False)
|
||||
|
||||
cls.bspec = ArgSpec(args=[],
|
||||
varargs='names',
|
||||
keywords='kwargs',
|
||||
defaults=None)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
del cls.aspec
|
||||
del cls.bspec
|
||||
|
||||
def test_run_module_not_available(self):
|
||||
'''
|
||||
|
@ -88,15 +94,15 @@ class ModuleStateTest(TestCase, LoaderModuleMockMixin):
|
|||
assert ret['comment'] == "Unavailable function: {0}.".format(CMD)
|
||||
assert not ret['result']
|
||||
|
||||
@patch('salt.utils.args.get_function_argspec', MagicMock(return_value=bspec))
|
||||
def test_module_run_hidden_varargs(self):
|
||||
'''
|
||||
Tests the return of module.run state when hidden varargs are used with
|
||||
wrong type.
|
||||
'''
|
||||
ret = module.run(CMD, m_names = 'anyname')
|
||||
comment = "'names' must be a list."
|
||||
self.assertEqual(ret['comment'], comment)
|
||||
with patch('salt.utils.args.get_function_argspec', MagicMock(return_value=self.bspec)):
|
||||
ret = module._run(CMD, m_names='anyname')
|
||||
comment = "'names' must be a list."
|
||||
self.assertEqual(ret['comment'], comment)
|
||||
|
||||
def test_run_testmode(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue