diff options
| author | Michael Merickel <github@m.merickel.org> | 2019-01-29 16:10:12 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-29 16:10:12 -0800 |
| commit | 32714630c4c84a411c1b773e0f736579c142df9c (patch) | |
| tree | b697bd00a90c32d3d101d5fde015259afcf87541 /tests/test_exceptions.py | |
| parent | 7bd9da72c63124c7ca007f4fa2113633bba5c403 (diff) | |
| parent | a5e0dd71d603573b2e3c366a60729caa725c9ac4 (diff) | |
| download | pyramid-32714630c4c84a411c1b773e0f736579c142df9c.tar.gz pyramid-32714630c4c84a411c1b773e0f736579c142df9c.tar.bz2 pyramid-32714630c4c84a411c1b773e0f736579c142df9c.zip | |
Merge pull request #3456 from mmerickel/fix-non-sortable-discriminators
Fix non sortable 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): |
