'Test JMX configs are read and converted to YAML'

@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(SDDockerBackend, 'get_configs', return_value=jmx_sd_configs)
def test_read_jmx_config_from_store(self, *args):

    jmx_configs = generate_jmx_configs(self.auto_conf_agentConfig, 'jmxhost')
    valid_configs = {'solr_0': "init_config:    {}\ninstances:\n-    host:    localhost\n        password:    bar\n        port:    '9999'\n        username:    foo\n-    host:    remotehost\n        password:    bar\n        port:    '5555'\n        username:    haz\n", 'tomcat_0': "init_config:    {}\ninstances:\n-    host:    localhost\n        port:    '9012'\n"}
    for check in self.jmx_sd_configs:
        key = '{}_0'.format(check)
        self.assertEquals(jmx_configs[key], valid_configs[key])
