diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_config/test_routes.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_config/test_routes.py b/tests/test_config/test_routes.py index 32a64b4bd..e6540c343 100644 --- a/tests/test_config/test_routes.py +++ b/tests/test_config/test_routes.py @@ -54,6 +54,30 @@ class RoutesConfiguratorMixinTests(unittest.TestCase): config.add_route('name', 'path') self._assertRoute(config, 'name', 'root/path') + def test_add_route_with_inherit_errors(self): + from pyramid.exceptions import ConfigurationError + + config = self._makeOne(autocommit=True) + self.assertRaises( + ConfigurationError, + config.add_route, + 'name', + '/', + inherit_slash=True, + ) + + def test_add_route_with_route_prefix_with_inherit_slash(self): + config = self._makeOne(autocommit=True) + config.route_prefix = 'root' + config.add_route('name', '', inherit_slash=True) + self._assertRoute(config, 'name', 'root') + + def test_add_route_with_root_slash_with_route_prefix(self): + config = self._makeOne(autocommit=True) + config.route_prefix = 'root' + config.add_route('name', '/') + self._assertRoute(config, 'name', 'root/') + def test_add_route_discriminator(self): config = self._makeOne() config.add_route('name', 'path') |
