diff options
| author | Michael Merickel <michael@merickel.org> | 2019-01-28 23:11:18 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2019-01-28 23:24:41 -0600 |
| commit | 8200b89a060a36396185e519999e27b43644b51f (patch) | |
| tree | 8252851c45569395735f0afd28e3868ace3ae653 /tests/test_exceptions.py | |
| parent | 7bd9da72c63124c7ca007f4fa2113633bba5c403 (diff) | |
| download | pyramid-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.py | 24 |
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): |
