def test(self): from papyrus_tilecache.views import load_tilecache_config curdir = os.path.dirname(os.path.abspath(__file__)) cfgfile = os.path.join(curdir, 'tilecache.cfg') settings = {'tilecache.cfg': cfgfile} load_tilecache_config(settings) from papyrus_tilecache.views import _service from TileCache.Service import Service self.assertTrue(isinstance(_service, Service)) self.assertTrue(_service.config.has_section('basic'))
def includeme(config): """ The callable making it possible to include papyrus_tilecache in a Pyramid application. Calling ``config.include(papyrus_tilecache)`` will result in this callable being called. Arguments: * ``config``: the ``pyramid.config.Configurator`` object. """ load_tilecache_config(config.get_settings()) add_route(config)
def test_tilecache(self): from papyrus_tilecache.views import tilecache from pyramid.request import Request from papyrus_tilecache.views import load_tilecache_config curdir = os.path.dirname(os.path.abspath(__file__)) cfgfile = os.path.join(curdir, 'tilecache.cfg') settings = {'tilecache.cfg': cfgfile} load_tilecache_config(settings) context = DummyContext() request = Request({}) response = tilecache(context, request) from pyramid.response import Response self.assertTrue(isinstance(response, Response))