'Fetch tile and check the existence of key with prefix in memcached'

def test_memcache_keyprefix(self):

    config_file_content = '\n                                {\n                                            "layers":{\n                                                        "memcache_osm":{\n                                                                    "provider":{\n                                                                                "name":"proxy",\n                                                                                "url":    "http://tile.openstreetmap.org/{Z}/{X}/{Y}.png"\n                                                                    }\n                                                        }\n                                                },\n                                                "cache":    {\n                                                                "name":    "Memcache",\n                                                                "servers":    ["127.0.0.1:11211"],\n                                                                "revision":    1,\n                                                                "key    prefix"    :    "cool_prefix"\n                                                }\n                                }\n                                '
    (tile_mimetype, tile_content) = utils.request(config_file_content, 'memcache_osm', 'png', 0, 0, 0)
    self.assertEqual(tile_mimetype, 'image/png')
    memcache_content = b64decode(self.mc.get('cool_prefix/1/memcache_osm/0/0/0.PNG').encode('ascii'))
    self.assertEqual(memcache_content, tile_content, 'Contents    of    memcached    and    value    returned    from    TileStache    should    match')
    self.assertIsNone(self.mc.get('/1/memcache_osm/0/0/0.PNG'), 'Memcache    value    should    be    empty')
