'Test read_config_from_store'

@mock.patch('config.get_auto_confd_path', return_value=os.path.join(os.path.dirname(__file__), 'fixtures/auto_conf/'))
@mock.patch.object(_TemplateCache, '_issue_read', side_effect=issue_read)
def test_read_config_from_store(self, *args):

    valid_idents = [('nginx', 'nginx'), ('nginx:latest', 'nginx:latest'), ('custom-nginx', 'custom-nginx'), ('custom-nginx:latest', 'custom-nginx'), ('repo/custom-nginx:latest', 'custom-nginx'), ('repo/dir:5000/custom-nginx:latest', 'repo/dir:5000/custom-nginx:latest')]
    invalid_idents = ['foo']
    config_store = get_config_store(self.auto_conf_agentConfig)
    for (ident, expected_key) in valid_idents:
        tpl = config_store.read_config_from_store(ident)
        self.assertEquals(tpl, {CONFIG_FROM_AUTOCONF: None, CONFIG_FROM_TEMPLATE: self.mock_raw_templates.get(expected_key)})
    for ident in invalid_idents:
        self.assertEquals(config_store.read_config_from_store(ident), [])
