diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-09-14 12:11:44 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-09-14 12:11:44 +0000 |
| commit | 70f1cda02f9acccf7ee1c8ad1a7ade36fba10dba (patch) | |
| tree | af2236494ee485c40575bb728d5755de1d579ace /repoze/bfg/tests/test_configuration.py | |
| parent | 7edbac105bdde5cf27ea397343c748ec24b11bd8 (diff) | |
| download | pyramid-70f1cda02f9acccf7ee1c8ad1a7ade36fba10dba.tar.gz pyramid-70f1cda02f9acccf7ee1c8ad1a7ade36fba10dba.tar.bz2 pyramid-70f1cda02f9acccf7ee1c8ad1a7ade36fba10dba.zip | |
- The ``add_route`` method of a Configurator now accepts a
``pregenerator`` argument. The pregenerator for the resulting route
is called by ``route_url`` in order to adjust the set of arguments
passed to it by the user for special purposes, such as Pylons
'subdomain' support. It will influence the URL returned by
``route_url``. See the ``repoze.bfg.interfaces.IRoutePregenerator``
interface for more information.
Diffstat (limited to 'repoze/bfg/tests/test_configuration.py')
| -rw-r--r-- | repoze/bfg/tests/test_configuration.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_configuration.py b/repoze/bfg/tests/test_configuration.py index b095c5c4c..47649d6ba 100644 --- a/repoze/bfg/tests/test_configuration.py +++ b/repoze/bfg/tests/test_configuration.py @@ -2024,6 +2024,11 @@ class ConfiguratorTests(unittest.TestCase): config = self._makeOne() self.assertRaises(ConfigurationError, config.add_route, 'name') + def test_add_route_with_pregenerator(self): + config = self._makeOne() + route = config.add_route('name', 'pattern', pregenerator='123') + self.assertEqual(route.pregenerator, '123') + def test__override_not_yet_registered(self): from repoze.bfg.interfaces import IPackageOverrides package = DummyPackage('package') |
