Skip to content

Commit

Permalink
Add unit test to get opts from the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Maryniuk authored and terminalmage committed Jun 14, 2018
1 parent 8fe31c3 commit d4b487e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ def test_get_module_environment_empty(self):
out = salt.utils.get_module_environment({})
assert out == {}
assert isinstance(out, dict)

def test_get_module_environment_opts(self):
'''
Test for salt.utils.get_module_environment
:return:
'''
expectation = {'message': 'Melting hard drives'}
_globals = {'__opts__': {'system-environment': {'salt.in.system': expectation}},
'__file__': '/daemons/loose/in/system.py'}
assert salt.utils.get_module_environment(_globals) == expectation

0 comments on commit d4b487e

Please sign in to comment.