summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2018-11-11 22:39:52 -0600
committerMichael Merickel <michael@merickel.org>2018-11-11 23:45:24 -0600
commitdff0798e352d0afeeec2058200ac983692b606c2 (patch)
tree9e6c4da2d683db86808437e0af1aad1231cdc846 /tests
parentebb56ebe4dd0cbecd6d19b5741ddf52c96a0176d (diff)
downloadpyramid-dff0798e352d0afeeec2058200ac983692b606c2.tar.gz
pyramid-dff0798e352d0afeeec2058200ac983692b606c2.tar.bz2
pyramid-dff0798e352d0afeeec2058200ac983692b606c2.zip
use inherit_slash=True on add_route to opt-in to no trailing slash
Diffstat (limited to 'tests')
-rw-r--r--tests/test_config/test_routes.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/test_config/test_routes.py b/tests/test_config/test_routes.py
index 1c1ed6700..e6540c343 100644
--- a/tests/test_config/test_routes.py
+++ b/tests/test_config/test_routes.py
@@ -54,10 +54,22 @@ class RoutesConfiguratorMixinTests(unittest.TestCase):
config.add_route('name', 'path')
self._assertRoute(config, 'name', 'root/path')
- def test_add_route_with_empty_string_with_route_prefix(self):
+ 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', '')
+ config.add_route('name', '', inherit_slash=True)
self._assertRoute(config, 'name', 'root')
def test_add_route_with_root_slash_with_route_prefix(self):