summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_urldispatch.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-01-25 20:52:35 +0000
committerChris McDonough <chrism@agendaless.com>2009-01-25 20:52:35 +0000
commit8cfe7068783a3520aa3bc09f260502d002e9ac60 (patch)
treea05a4b50ce747cfef448ef795b349d0128601549 /repoze/bfg/tests/test_urldispatch.py
parenta6e0463027dee43c6aac487a9ea8bb844b1e8add (diff)
downloadpyramid-8cfe7068783a3520aa3bc09f260502d002e9ac60.tar.gz
pyramid-8cfe7068783a3520aa3bc09f260502d002e9ac60.tar.bz2
pyramid-8cfe7068783a3520aa3bc09f260502d002e9ac60.zip
- The ``repoze.bfg.urldispatch.RoutesRootFactory`` now injects the
``wsgiorg.routing_args`` environment variable into the environ when a route matches. This is a tuple of ((), routing_args) where routing_args is the value that comes back from the routes mapper match (the "match dict"). - The ``repoze.bfg.traversal.RoutesModelTraverser`` class now wants to obtain the ``view_name`` and ``subpath`` from the ``wsgiorgs.routing_args`` environment variable. It falls back to obtaining these from the context for backwards compatibility.
Diffstat (limited to 'repoze/bfg/tests/test_urldispatch.py')
-rw-r--r--repoze/bfg/tests/test_urldispatch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_urldispatch.py b/repoze/bfg/tests/test_urldispatch.py
index e332351a7..71ac78698 100644
--- a/repoze/bfg/tests/test_urldispatch.py
+++ b/repoze/bfg/tests/test_urldispatch.py
@@ -111,6 +111,10 @@ class RoutesRootFactoryTests(unittest.TestCase):
self.assertEqual(result.view_name, 'foo')
self.assertEqual(result.action, 'action1')
self.assertEqual(result.article, 'article1')
+ routing_args = environ['wsgiorg.routing_args'][1]
+ self.assertEqual(routing_args['view_name'], 'foo')
+ self.assertEqual(routing_args['action'], 'action1')
+ self.assertEqual(routing_args['article'], 'article1')
def test_unicode_in_route_default(self):
marker = ()
@@ -128,6 +132,8 @@ class RoutesRootFactoryTests(unittest.TestCase):
from repoze.bfg.interfaces import IRoutesContext
self.failUnless(IRoutesContext.providedBy(result))
self.assertEqual(getattr(result, la.encode('utf-8')), 'id')
+ routing_args = environ['wsgiorg.routing_args'][1]
+ self.assertEqual(routing_args[la.encode('utf-8')], 'id')
def test_no_fallback_get_root(self):
marker = ()