'Test _get_config_templates with mocked get_check_tpls'

@mock.patch('config.get_auto_confd_path', return_value=os.path.join(os.path.dirname(__file__), 'fixtures/auto_conf/'))
@mock.patch('utils.dockerutil.DockerUtil.client', return_value=None)
@mock.patch.object(ConsulStore, 'get_client', return_value=None)
@mock.patch.object(EtcdStore, 'get_client', return_value=None)
@mock.patch.object(AbstractConfigStore, 'get_check_tpls', side_effect=_get_check_tpls)
def test_get_config_templates(self, *args):

    for agentConfig in self.agentConfigs:
        sd_backend = get_sd_backend(agentConfig=agentConfig)
        for image in self.mock_templates.keys():
            template = sd_backend._get_config_templates(image)
            expected_template = self.mock_templates.get(image)[0]
            self.assertEquals(template, expected_template)
        for image in self.bad_mock_templates.keys():
            self.assertEquals(sd_backend._get_config_templates(image), None)
        clear_singletons(agentConfig)
