'test get_templates'

@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', return_value=None)
def test_get_templates(self, *args):

    kv_tpls = {'foo': [['check0', 'check1'], [{}, {}], [{}, {}]], 'bar': [['check2', 'check3'], [{}, {}], [{}, {}]]}
    auto_tpls = {'foo': [['check3', 'check5'], [{}, {}], [{}, {}]], 'bar': [['check2', 'check6'], [{}, {}], [{}, {}]], 'foobar': [['check4'], [{}], [{}]]}
    cache = _TemplateCache(issue_read, '')
    cache.kv_templates = kv_tpls
    cache.auto_conf_templates = auto_tpls
    self.assertEquals(cache.get_templates('foo'), {CONFIG_FROM_TEMPLATE: [['check0', 'check1'], [{}, {}], [{}, {}]], CONFIG_FROM_AUTOCONF: [['check3', 'check5'], [{}, {}], [{}, {}]]})
    self.assertEquals(cache.get_templates('bar'), {CONFIG_FROM_TEMPLATE: [['check2', 'check3'], [{}, {}], [{}, {}]], CONFIG_FROM_AUTOCONF: [['check6'], [{}], [{}]]})
    self.assertEquals(cache.get_templates('foobar'), {CONFIG_FROM_TEMPLATE: None, CONFIG_FROM_AUTOCONF: [['check4'], [{}], [{}]]})
    self.assertEquals(cache.get_templates('baz'), None)
