Skip to content

Commit

Permalink
Init tests are split by initializer' input
Browse files Browse the repository at this point in the history
  • Loading branch information
woxcab committed Mar 15, 2017
1 parent fbb411a commit a84652e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_utils_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@

class CaselessDictTest(unittest.TestCase):

def test_init(self):
def test_init_dict(self):
seq = {'red': 1, 'black': 3}
d = CaselessDict(seq)
self.assertEqual(d['red'], 1)
self.assertEqual(d['black'], 3)

def test_init_pair_sequence(self):
seq = (('red', 1), ('black', 3))
d = CaselessDict(seq)
self.assertEqual(d['red'], 1)
self.assertEqual(d['black'], 3)

def test_init_mapping(self):
class MyMapping(Mapping):
def __init__(self, **kwargs):
self._d = kwargs
Expand All @@ -37,6 +39,7 @@ def __len__(self):
self.assertEqual(d['red'], 1)
self.assertEqual(d['black'], 3)

def test_init_mutable_mapping(self):
class MyMutableMapping(MutableMapping):
def __init__(self, **kwargs):
self._d = kwargs
Expand Down

0 comments on commit a84652e

Please sign in to comment.