mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add unit test for _get_pillar_errors when external and internal pillars are clean
This commit is contained in:
parent
67034139d9
commit
3ce19356c2
@ -975,3 +975,19 @@ class StateTestCase(TestCase, LoaderModuleMockMixin):
|
||||
MockJson.flag = False
|
||||
with patch('salt.utils.fopen', mock_open()):
|
||||
self.assertTrue(state.pkg(tar_file, 0, "md5"))
|
||||
|
||||
def test_get_pillar_errors_CC(self):
|
||||
'''
|
||||
Test _get_pillar_errors function.
|
||||
CC: External clean, Internal clean
|
||||
:return:
|
||||
'''
|
||||
for int_pillar, ext_pillar in [({'foo': 'bar'}, {'fred': 'baz'}),
|
||||
({'foo': 'bar'}, None),
|
||||
({}, {'fred': 'baz'})]:
|
||||
with patch('salt.modules.state.__pillar__', int_pillar):
|
||||
for opts, res in [({'force': True}, None),
|
||||
({'force': False}, None),
|
||||
({}, None)]:
|
||||
assert res == state._get_pillar_errors(kwargs=opts, pillar=ext_pillar)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user