This commit is contained in:
Kovid Goyal 2016-02-19 14:15:17 +05:30
parent 1be07c21d9
commit 27527d4299

View File

@ -68,6 +68,10 @@ class TestRouter(BaseTest):
def quoting(ctx, dest, x): def quoting(ctx, dest, x):
pass pass
@endpoint('/get/{a}/{b=None}')
def get(ctx, dest, a, b):
pass
for x in locals().itervalues(): for x in locals().itervalues():
if getattr(x, 'is_endpoint', False): if getattr(x, 'is_endpoint', False):
router.add(x) router.add(x)
@ -98,3 +102,4 @@ class TestRouter(BaseTest):
self.ae(router.url_for('/needs quoting', x='a/b c'), '/needs quoting/a%2Fb%20c') self.ae(router.url_for('/needs quoting', x='a/b c'), '/needs quoting/a%2Fb%20c')
self.ae(router.url_for(None), '/') self.ae(router.url_for(None), '/')
self.ae(router.url_for('/get', a='1', b='xxx'), '/get/1/xxx')