'test _populate_auto_conf'

@mock.patch('utils.service_discovery.abstract_config_store.get_auto_conf_images')
def test_populate_auto_conf(self, mock_get_auto_conf_images):

    auto_tpls = {'foo': [['check0', 'check1'], [{}, {}], [{}, {}]], 'bar': [['check2', 'check3', 'check3'], [{}, {}, {}], [{}, {'foo': 'bar'}, {'bar': 'foo'}]]}
    cache = _TemplateCache(issue_read, '')
    cache.auto_conf_templates = defaultdict((lambda : ([[]] * 3)))
    mock_get_auto_conf_images.return_value = auto_tpls
    cache._populate_auto_conf()
    self.assertEquals(cache.auto_conf_templates['foo'], auto_tpls['foo'])
    self.assertEquals(cache.auto_conf_templates['bar'], [['check2', 'check3'], [{}, {}], [{}, {'foo': 'bar'}]])
