mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add unit test for _get_pillar_errors when external pillar has errors and internal is clean
This commit is contained in:
parent
3ce19356c2
commit
218a59e93b
1 changed files with 14 additions and 0 deletions
|
@ -991,3 +991,17 @@ class StateTestCase(TestCase, LoaderModuleMockMixin):
|
|||
({}, None)]:
|
||||
assert res == state._get_pillar_errors(kwargs=opts, pillar=ext_pillar)
|
||||
|
||||
def test_get_pillar_errors_EC(self):
|
||||
'''
|
||||
Test _get_pillar_errors function.
|
||||
EC: External erroneous, Internal clean
|
||||
:return:
|
||||
'''
|
||||
errors = ['failure', 'everywhere']
|
||||
for int_pillar, ext_pillar in [({'foo': 'bar'}, {'fred': 'baz', '_errors': errors}),
|
||||
({}, {'fred': 'baz', '_errors': ['failure', 'everywhere']})]:
|
||||
with patch('salt.modules.state.__pillar__', int_pillar):
|
||||
for opts, res in [({'force': True}, None),
|
||||
({'force': False}, errors),
|
||||
({}, errors)]:
|
||||
assert res == state._get_pillar_errors(kwargs=opts, pillar=ext_pillar)
|
||||
|
|
Loading…
Add table
Reference in a new issue