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"))
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.