diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-11-06 18:39:43 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-11-06 18:39:43 +0000 |
| commit | ab5bca41dea52042980c2a0432e98ef3ca8c2984 (patch) | |
| tree | c932c73b2cb49cb7856c6710f9c54e17a5b8b214 /repoze/bfg/tests/test_testing.py | |
| parent | e0f40e9e706043e9f5637ae39a082c60cbb5cb4b (diff) | |
| download | pyramid-ab5bca41dea52042980c2a0432e98ef3ca8c2984.tar.gz pyramid-ab5bca41dea52042980c2a0432e98ef3ca8c2984.tar.bz2 pyramid-ab5bca41dea52042980c2a0432e98ef3ca8c2984.zip | |
- ``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.
Diffstat (limited to 'repoze/bfg/tests/test_testing.py')
| -rw-r--r-- | repoze/bfg/tests/test_testing.py | 14 |
1 files changed, 14 insertions, 0 deletions
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 |
