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_static.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'repoze/bfg/tests/test_static.py') diff --git a/repoze/bfg/tests/test_static.py b/repoze/bfg/tests/test_static.py index 7c7b5627c..355afac2a 100644 --- a/repoze/bfg/tests/test_static.py +++ b/repoze/bfg/tests/test_static.py @@ -148,6 +148,13 @@ class TestPackageURLParser(unittest.TestCase): self.failUnless('404 Not Found' in body) self.assertEqual(sr.status, '404 Not Found') +class TestStaticRootFactory(unittest.TestCase): + def test_it(self): + from repoze.bfg.static import StaticRootFactory + factory = StaticRootFactory('abc') + self.assertEqual(factory.spec, 'abc') + self.assertEqual(factory({}), factory) + class DummyStartResponse: def __call__(self, status, headerlist, exc_info=None): self.status = status -- cgit v1.2.3