From 750ce41f217cd7b638ad5b69fcb9df1b49841b58 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 17 Sep 2009 19:58:01 +0000 Subject: - Add a ``repoze.bfg.url.static_url`` API which is capable of generating URLs to static resources defined by the ```` ZCML directive. See the "Views" narrative chapter's section titled "Generating Static Resource URLs" for more information. --- repoze/bfg/tests/test_urldispatch.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'repoze/bfg/tests/test_urldispatch.py') 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): -- cgit v1.2.3