Skip to content

Instantly share code, notes, and snippets.

@tswicegood
Created January 3, 2015 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tswicegood/ccb43b501ff8c3f7c4c5 to your computer and use it in GitHub Desktop.
Save tswicegood/ccb43b501ff8c3f7c4c5 to your computer and use it in GitHub Desktop.
def test_allows_nested_routes(self):
r = routes.Router()
@r.get("/foo")
def handle_foo(request):
return "\n".join([
"request.path: %s" % request.path,
"request.original_path: %s" % request.original_path,
])
a = app.Steinie()
a.use("/bar", r)
with utils.run_app(a):
response = utils.get("http://localhost:5151/bar/foo")
expected = "\n".join([
"request.path: /foo",
"request.original_path: /bar/foo",
])
self.assertEqual(expected, response.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment