summaryrefslogtreecommitdiff
path: root/tests/test_exceptions.py
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2019-01-28 23:11:18 -0600
committerMichael Merickel <michael@merickel.org>2019-01-28 23:24:41 -0600
commit8200b89a060a36396185e519999e27b43644b51f (patch)
tree8252851c45569395735f0afd28e3868ace3ae653 /tests/test_exceptions.py
parent7bd9da72c63124c7ca007f4fa2113633bba5c403 (diff)
downloadpyramid-8200b89a060a36396185e519999e27b43644b51f.tar.gz
pyramid-8200b89a060a36396185e519999e27b43644b51f.tar.bz2
pyramid-8200b89a060a36396185e519999e27b43644b51f.zip
test unsortable discriminators
Diffstat (limited to 'tests/test_exceptions.py')
-rw-r--r--tests/test_exceptions.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index 399940c05..e7a2871a5 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -1,3 +1,4 @@
+from collections import OrderedDict
import unittest
@@ -72,7 +73,9 @@ class TestConfigurationConflictError(unittest.TestCase):
return ConfigurationConflictError(conflicts)
def test_str(self):
- conflicts = {'a': ('1', '2', '3'), 'b': ('4', '5', '6')}
+ conflicts = OrderedDict()
+ conflicts['a'] = ('1', '2', '3')
+ conflicts['b'] = ('4', '5', '6')
exc = self._makeOne(conflicts)
self.assertEqual(
str(exc),
@@ -88,6 +91,25 @@ Conflicting configuration actions
6""",
)
+ def test_non_sortable_discriminators_in_str(self):
+ conflicts = OrderedDict()
+ conflicts['a'] = ('1', '2', '3')
+ conflicts[None] = ('4', '5', '6')
+ exc = self._makeOne(conflicts)
+ self.assertEqual(
+ str(exc),
+ """\
+Conflicting configuration actions
+ For: a
+ 1
+ 2
+ 3
+ For: None
+ 4
+ 5
+ 6""",
+ )
+
class TestConfigurationExecutionError(unittest.TestCase):
def _makeOne(self, etype, evalue, info):