]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Test for https://github.com/facebook/tornado/pull/454
authorBen Darnell <ben@bendarnell.com>
Mon, 20 Feb 2012 04:08:26 +0000 (20:08 -0800)
committerBen Darnell <ben@bendarnell.com>
Mon, 20 Feb 2012 04:08:26 +0000 (20:08 -0800)
tornado/test/web_test.py
website/sphinx/releases/next.rst

index c292b419a5cd241804b09316ad7402a1ca4779f2..f65b1f68bc2743a51daf615e7b847502a6ac4c22 100644 (file)
@@ -670,3 +670,19 @@ class CustomStaticFileTest(AsyncHTTPTestCase, LogTrapTestCase):
     def test_static_url(self):
         response = self.fetch("/static_url/foo.txt")
         self.assertEqual(response.body, b("/static/foo.42.txt"))
+
+class NamedURLSpecGroupsTest(AsyncHTTPTestCase, LogTrapTestCase):
+    def get_app(self):
+        class EchoHandler(RequestHandler):
+            def get(self, path):
+                self.write(path)
+
+        return Application([("/str/(?P<path>.*)", EchoHandler),
+                            (u"/unicode/(?P<path>.*)", EchoHandler)])
+
+    def test_named_urlspec_groups(self):
+        response = self.fetch("/str/foo")
+        self.assertEqual(response.body, b("foo"))
+
+        response = self.fetch("/unicode/bar")
+        self.assertEqual(response.body, b("bar"))
index a6c7faf4173436aef815e75d684c167cd5ba302b..1a47759f2b9917c3e6622065255ed9c13073abb0 100644 (file)
@@ -13,3 +13,5 @@ In progress
   overwrite the previous cookie instead of producing additional copies.
 * `tornado.simple_httpclient` correctly verifies SSL certificates for
   URLs containing IPv6 literals (This bug affected Python 2.5 and 2.6).
+* Fixed a bug on python versions before 2.6.5 when `URLSpec` regexes
+  are constructed from unicode strings and keyword arguments are extracted.