summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFang-Pen Lin <bornstub@gmail.com>2017-05-22 14:38:53 -0700
committerFang-Pen Lin <bornstub@gmail.com>2017-05-22 14:38:53 -0700
commitaafaf73655c11ca1d6645d85e1754be6996540dd (patch)
treee0fc20693db1dc1443d02a70fae9655c4238b84a
parent8c4d422965b633f31967ceed1e6cc25cc616d0bf (diff)
downloadpyramid-aafaf73655c11ca1d6645d85e1754be6996540dd.tar.gz
pyramid-aafaf73655c11ca1d6645d85e1754be6996540dd.tar.bz2
pyramid-aafaf73655c11ca1d6645d85e1754be6996540dd.zip
Add test for closest predicate error message
-rw-r--r--pyramid/tests/test_config/test_util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pyramid/tests/test_config/test_util.py b/pyramid/tests/test_config/test_util.py
index 398b6fba8..bb86a1f56 100644
--- a/pyramid/tests/test_config/test_util.py
+++ b/pyramid/tests/test_config/test_util.py
@@ -365,6 +365,16 @@ class TestPredicateList(unittest.TestCase):
from pyramid.exceptions import ConfigurationError
self.assertRaises(ConfigurationError, self._callFUT, unknown=1)
+ def test_predicate_close_matches(self):
+ from pyramid.exceptions import ConfigurationError
+ with self.assertRaises(ConfigurationError) as context:
+ self._callFUT(method='GET')
+ expected_msg = (
+ "Unknown predicate values: {'method': 'GET'} "
+ "(did you mean request_method)"
+ )
+ self.assertEqual(context.exception.args[0], expected_msg)
+
def test_notted(self):
from pyramid.config import not_
from pyramid.testing import DummyRequest