mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #43092 from mitodl/2016.11
Fixed issue with silently passing all tests in Testinfra module
This commit is contained in:
commit
e51333306c
1 changed files with 9 additions and 4 deletions
|
@ -242,6 +242,8 @@ def _copy_function(module_name, name=None):
|
|||
elif hasattr(mod, '__call__'):
|
||||
mod_sig = inspect.getargspec(mod.__call__)
|
||||
parameters = mod_sig.args
|
||||
log.debug('Parameters accepted by module {0}: {1}'.format(module_name,
|
||||
parameters))
|
||||
additional_args = {}
|
||||
for arg in set(parameters).intersection(set(methods.keys())):
|
||||
additional_args[arg] = methods.pop(arg)
|
||||
|
@ -251,12 +253,15 @@ def _copy_function(module_name, name=None):
|
|||
else:
|
||||
modinstance = mod()
|
||||
except TypeError:
|
||||
modinstance = None
|
||||
methods = {}
|
||||
log.exception('Module failed to instantiate')
|
||||
raise
|
||||
valid_methods = {}
|
||||
log.debug('Called methods are: {0}'.format(methods))
|
||||
for meth_name in methods:
|
||||
if not meth_name.startswith('_'):
|
||||
methods[meth_name] = methods[meth_name]
|
||||
for meth, arg in methods.items():
|
||||
valid_methods[meth_name] = methods[meth_name]
|
||||
log.debug('Valid methods are: {0}'.format(valid_methods))
|
||||
for meth, arg in valid_methods.items():
|
||||
result = _get_method_result(mod, modinstance, meth, arg)
|
||||
assertion_result = _apply_assertion(arg, result)
|
||||
if not assertion_result:
|
||||
|
|
Loading…
Add table
Reference in a new issue