Permalink
Browse files

test unsortable discriminators

  • Loading branch information...
mmerickel committed Jan 29, 2019
1 parent 7bd9da7 commit 8200b89a060a36396185e519999e27b43644b51f
Showing with 23 additions and 1 deletion.
  1. +23 −1 tests/test_exceptions.py
@@ -1,3 +1,4 @@
from collections import OrderedDict
import unittest


@@ -72,7 +73,9 @@ def _makeOne(self, conflicts):
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 @@ def test_str(self):
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):

0 comments on commit 8200b89

Please sign in to comment.