summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_urldispatch.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-09-17 19:58:01 +0000
committerChris McDonough <chrism@agendaless.com>2009-09-17 19:58:01 +0000
commit750ce41f217cd7b638ad5b69fcb9df1b49841b58 (patch)
treea0a8edbc60694d3ae16b70570b0184a8ef28ee65 /repoze/bfg/tests/test_urldispatch.py
parent19473e78e61ad084f07a0f7820a75b6c64d93dcd (diff)
downloadpyramid-750ce41f217cd7b638ad5b69fcb9df1b49841b58.tar.gz
pyramid-750ce41f217cd7b638ad5b69fcb9df1b49841b58.tar.bz2
pyramid-750ce41f217cd7b638ad5b69fcb9df1b49841b58.zip
- Add a ``repoze.bfg.url.static_url`` API which is capable of
generating URLs to static resources defined by the ``<static>`` ZCML directive. See the "Views" narrative chapter's section titled "Generating Static Resource URLs" for more information.
Diffstat (limited to 'repoze/bfg/tests/test_urldispatch.py')
-rw-r--r--repoze/bfg/tests/test_urldispatch.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_urldispatch.py b/repoze/bfg/tests/test_urldispatch.py
index 1de3d6f3b..faa375dbd 100644
--- a/repoze/bfg/tests/test_urldispatch.py
+++ b/repoze/bfg/tests/test_urldispatch.py
@@ -120,6 +120,15 @@ class RoutesRootFactoryTests(unittest.TestCase):
mapper.connect('whatever', 'archives/:action/:article')
self.assertEqual(mapper.has_routes(), True)
+ def test_get_routes(self):
+ from repoze.bfg.urldispatch import Route
+ mapper = self._makeOne(None)
+ self.assertEqual(mapper.get_routes(), [])
+ mapper.connect('whatever', 'archives/:action/:article')
+ routes = mapper.get_routes()
+ self.assertEqual(len(routes), 1)
+ self.assertEqual(routes[0].__class__, Route)
+
def test_generate(self):
mapper = self._makeOne(None)
def generator(kw):