summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests
diff options
context:
space:
mode:
Diffstat (limited to 'repoze/bfg/tests')
-rw-r--r--repoze/bfg/tests/test_router.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_router.py b/repoze/bfg/tests/test_router.py
index 589843b0f..be4fbad59 100644
--- a/repoze/bfg/tests/test_router.py
+++ b/repoze/bfg/tests/test_router.py
@@ -876,6 +876,26 @@ class TestDefaultForbiddenView(unittest.TestCase):
response = self._callFUT(context, request)
self.failUnless('<code>abc&amp;123</code>' in response.body)
+class TestDefaultRootFactory(unittest.TestCase):
+ def _getTargetClass(self):
+ from repoze.bfg.router import DefaultRootFactory
+ return DefaultRootFactory
+
+ def _makeOne(self, environ):
+ return self._getTargetClass()(environ)
+
+ def test_no_matchdict(self):
+ environ = {}
+ root = self._makeOne(environ)
+ self.assertEqual(root.__parent__, None)
+ self.assertEqual(root.__name__, None)
+
+ def test_matchdict(self):
+ environ = {'bfg.routes.matchdict':{'a':1, 'b':2}}
+ root = self._makeOne(environ)
+ self.assertEqual(root.a, 1)
+ self.assertEqual(root.b, 2)
+
class DummyRegistryManager:
def push(self, registry):