changeset 4910:e5f90a69f660 routing

routing: Fix router test
author anatoly techtonik <techtonik@gmail.com>
date Wed, 16 Jul 2014 03:22:05 +0300
parents f31c93abedf6
children 2502a9dde1ac
files roundup/web/router.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/web/router.py	Wed Jul 16 03:17:54 2014 +0300
+++ b/roundup/web/router.py	Wed Jul 16 03:22:05 2014 +0300
@@ -25,7 +25,7 @@
 
 EXAMPLE_URLMAP = (
     'static/(.*)', ExampleFileHandler,
-    '', ExampleHandler
+    'index', ExampleHandler
 )
 
 
@@ -51,7 +51,7 @@
         path = urlpath.lstrip('/')
         for i in range(0, len(self.urlmap), 2):
             pattern, handler = self.urlmap[i], self.urlmap[i+1]
-            match = re.match(pattern, urlpath)
+            match = re.match(pattern, path)
             if match:
                 return handler, match.groups()
         return (None, ())
@@ -68,7 +68,7 @@
         def test_example_routes(self):
             router = Router(EXAMPLE_URLMAP)
             self.assertEquals(router.get_handler(''), (None, ()))
-            handler, params = router.get_handler('/')
+            handler, params = router.get_handler('/index')
             self.assertEquals(handler, ExampleHandler)
             self.assertEquals(params, tuple())
 

Roundup Issue Tracker: http://roundup-tracker.org/