summaryrefslogtreecommitdiff
path: root/tests/test_config/test_routes.py
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2018-11-01 21:05:04 -0500
committerMichael Merickel <michael@merickel.org>2018-11-02 09:54:28 -0500
commit0cef6bc5d627524354c47295df7a0aa84a64539e (patch)
tree05c3c6163ba096f8aeda882c25e4b405fce4423e /tests/test_config/test_routes.py
parentaa1660f3d9a5dc654a91544d72de596af2fdf9ba (diff)
downloadpyramid-0cef6bc5d627524354c47295df7a0aa84a64539e.tar.gz
pyramid-0cef6bc5d627524354c47295df7a0aa84a64539e.tar.bz2
pyramid-0cef6bc5d627524354c47295df7a0aa84a64539e.zip
remove deprecated media range support from add_view and add_route
Diffstat (limited to 'tests/test_config/test_routes.py')
-rw-r--r--tests/test_config/test_routes.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/test_config/test_routes.py b/tests/test_config/test_routes.py
index d6f45608d..32a64b4bd 100644
--- a/tests/test_config/test_routes.py
+++ b/tests/test_config/test_routes.py
@@ -216,17 +216,12 @@ class RoutesConfiguratorMixinTests(unittest.TestCase):
request.accept = DummyAccept('text/html')
self.assertEqual(predicate(None, request), False)
- def test_add_route_with_wildcard_accept(self):
+ def test_add_route_with_wildcard_accept_raises(self):
config = self._makeOne(autocommit=True)
- config.add_route('name', 'path', accept='text/*')
- route = self._assertRoute(config, 'name', 'path', 1)
- predicate = route.predicates[0]
- request = self._makeRequest(config)
- request.accept = DummyAccept('text/xml', contains=True)
- self.assertEqual(predicate(None, request), True)
- request = self._makeRequest(config)
- request.accept = DummyAccept('application/json', contains=False)
- self.assertEqual(predicate(None, request), False)
+ self.assertRaises(
+ ValueError,
+ lambda: config.add_route('name', 'path', accept='text/*'),
+ )
def test_add_route_no_pattern_with_path(self):
config = self._makeOne(autocommit=True)
@@ -313,6 +308,3 @@ class DummyAccept(object):
if match in offers:
results.append((match, 1.0))
return results
-
- def __contains__(self, value):
- return self.contains