From e9a24aa449fb68bcd7dbd9d6f295827c83523cc6 Mon Sep 17 00:00:00 2001 From: 38elements Date: Sun, 30 Apr 2017 19:01:17 +0900 Subject: [PATCH] Add test for uri_template --- tests/test_requests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_requests.py b/tests/test_requests.py index c0824850..b30b4c90 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -133,6 +133,17 @@ def test_query_string(): assert request.args.get('test2') == 'false' +def test_uri_template(): + app = Sanic('test_uri_template') + + @app.route('/foo//bar/') + async def handler(request): + return text('OK') + + request, response = app.test_client.get('/foo/123/bar/baz') + assert request.uri_template == '/foo//bar/' + + def test_token(): app = Sanic('test_post_token')