Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Fixture to check if resolve
def url_checker():
from pyramid.scripts.pviews import PViewsCommand
from pyramid.request import Request
from pyramid.paster import bootstrap
def view_match(url):
pviews = PViewsCommand([None, os.path.join(here, '../', 'development.ini'), url],
config_uri = pviews.args[0]
url = pviews.args[1]
request = Request.blank(url)
env = bootstrap(config_uri, request=request)
view = pviews._find_view(request)
result = True
if view is None:
result = False
return result
return view_match
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment