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:
Mike Place 2018-03-21 19:22:48 +00:00 committed by GitHub
commit 33af3cfc7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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