fix test_malformed_pillar_sls

This commit is contained in:
Marlowe W 2018-01-22 11:19:43 +08:00
parent 32a980a8b7
commit 5875d338a7

View File

@ -296,7 +296,8 @@ class PillarTestCase(TestCase):
'mocked-minion', 'fake_pillar', 'bar',
extra_minion_data={'fake_key': 'foo'})
def test_malformed_pillar_sls(self):
@patch('salt.fileclient.Client.list_states')
def test_malformed_pillar_sls(self, mock_list_states):
with patch('salt.pillar.compile_template') as compile_template:
opts = {
'renderer': 'json',
@ -316,6 +317,7 @@ class PillarTestCase(TestCase):
'kernel': 'Linux'
}
mock_list_states.return_value = ['foo', 'blah']
pillar = salt.pillar.Pillar(opts, grains, 'mocked-minion', 'base')
# Mock getting the proper template files
pillar.client.get_state = MagicMock(