mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Add unit test for module name is found.
This commit is contained in:
parent
9c71e71ffe
commit
5fb9e8b22d
@ -87,3 +87,19 @@ class UtilsTestCase(TestCase):
|
||||
|
||||
_globals['__file__'] = '/route/jumping/interference.py'
|
||||
assert salt.utils.get_module_environment(_globals) == expectation
|
||||
|
||||
def test_get_module_environment_mname_found(self):
|
||||
'''
|
||||
Test for salt.utils.get_module_environment
|
||||
Module name is found.
|
||||
|
||||
:return:
|
||||
'''
|
||||
expectation = {'msg': 'All operators are on strike due to broken coffee machine!'}
|
||||
_globals = {
|
||||
'__pillar__': {'system-environment': {'salt.jumping.nonsense': expectation}},
|
||||
'__file__': '/route/jumping/interference.py'
|
||||
}
|
||||
assert salt.utils.get_module_environment(_globals) == {}
|
||||
_globals['__pillar__']['system-environment']['salt.jumping.interference'] = expectation
|
||||
assert salt.utils.get_module_environment(_globals) == expectation
|
||||
|
Loading…
Reference in New Issue
Block a user