From ab5bca41dea52042980c2a0432e98ef3ca8c2984 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 6 Nov 2009 18:39:43 +0000 Subject: - ``repoze.bfg.testing.registerRoutesMapper`` testing facility added. This testing function registers a routes "mapper" object in the registry, for tests which require its presence. This function is documented in the ``repoze.bfg.testing`` API documentation. --- repoze/bfg/tests/test_testing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'repoze/bfg/tests/test_testing.py') diff --git a/repoze/bfg/tests/test_testing.py b/repoze/bfg/tests/test_testing.py index 130dc9105..4981b6d68 100644 --- a/repoze/bfg/tests/test_testing.py +++ b/repoze/bfg/tests/test_testing.py @@ -277,6 +277,20 @@ class TestTestingFunctions(unittest.TestCase): self.assertEqual(route_url('home', request, pagename='abc'), 'http://example.com/abc') + def test_registerRoutesMapper(self): + from repoze.bfg.interfaces import IRoutesMapper + from repoze.bfg.testing import registerRoutesMapper + from zope.component import getSiteManager + class Factory: + def __init__(self, environ): + """ """ + class DummyRequest: + application_url = 'http://example.com' + result = registerRoutesMapper() + sm = getSiteManager() + mapper = sm.getUtility(IRoutesMapper) + self.assertEqual(result, mapper) + def test_registerSettings(self): from repoze.bfg.interfaces import ISettings from repoze.bfg.testing import registerSettings -- cgit v1.2.3