From 70f1cda02f9acccf7ee1c8ad1a7ade36fba10dba Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 14 Sep 2010 12:11:44 +0000 Subject: - 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. --- repoze/bfg/tests/test_configuration.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'repoze/bfg/tests/test_configuration.py') 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') -- cgit v1.2.3