Add unit test for module name is found.

This commit is contained in:
Bo Maryniuk 2018-06-07 10:18:36 +02:00 committed by Erik Johnson
parent 9c71e71ffe
commit 5fb9e8b22d
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -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