mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #46631 from rallytime/update-pillar-unit-tests
Fix pillar unit test failures: file_roots and pillar_roots environments should be lists
This commit is contained in:
commit
33af3cfc7c
@ -55,13 +55,13 @@ class PillarTestCase(TestCase):
|
||||
'renderer_blacklist': [],
|
||||
'renderer_whitelist': [],
|
||||
'state_top': '',
|
||||
'pillar_roots': {'__env__': '/srv/pillar/__env__', 'base': '/srv/pillar/base'},
|
||||
'file_roots': {'base': '/srv/salt/base', 'dev': '/svr/salt/dev'},
|
||||
'pillar_roots': {'__env__': ['/srv/pillar/__env__'], 'base': ['/srv/pillar/base']},
|
||||
'file_roots': {'base': ['/srv/salt/base'], 'dev': ['/svr/salt/dev']},
|
||||
'extension_modules': '',
|
||||
}
|
||||
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='dev')
|
||||
self.assertEqual(pillar.opts['file_roots'],
|
||||
{'base': '/srv/pillar/base', 'dev': '/srv/pillar/__env__'})
|
||||
{'base': ['/srv/pillar/base'], 'dev': ['/srv/pillar/__env__']})
|
||||
|
||||
def test_ignored_dynamic_pillarenv(self):
|
||||
opts = {
|
||||
@ -69,12 +69,12 @@ class PillarTestCase(TestCase):
|
||||
'renderer_blacklist': [],
|
||||
'renderer_whitelist': [],
|
||||
'state_top': '',
|
||||
'pillar_roots': {'__env__': '/srv/pillar/__env__', 'base': '/srv/pillar/base'},
|
||||
'file_roots': {'base': '/srv/salt/base', 'dev': '/svr/salt/dev'},
|
||||
'pillar_roots': {'__env__': ['/srv/pillar/__env__'], 'base': ['/srv/pillar/base']},
|
||||
'file_roots': {'base': ['/srv/salt/base'], 'dev': ['/svr/salt/dev']},
|
||||
'extension_modules': '',
|
||||
}
|
||||
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='base')
|
||||
self.assertEqual(pillar.opts['file_roots'], {'base': '/srv/pillar/base'})
|
||||
self.assertEqual(pillar.opts['file_roots'], {'base': ['/srv/pillar/base']})
|
||||
|
||||
def test_malformed_pillar_sls(self):
|
||||
with patch('salt.pillar.compile_template') as compile_template:
|
||||
|
Loading…
Reference in New Issue
Block a user