def test4(self): L = DictSet(s2d('a1 c5666788')) with self.assertRaises(TypeError) as cm: L.add('d', []) self.assertEqual(str(cm.exception), "unhashable type: 'list'")
def test7(self): L = DictSet(s2d('a123 b456 c0')) R = s2l('a123 b456 c0') L.add('c') # shouldn't do anything self.assertEqual(d2l(L), R)
def test6(self): L = DictSet(s2d('b456')) R = s2l('b456 c0') L.add('c') self.assertEqual(d2l(L), R)
def test5(self): L = DictSet(s2d('b456')) R = s2l('b456') L.add('b') self.assertEqual(d2l(L), R) # b should stay unaltered
def test3(self): L = DictSet(s2d('a1 c5666788')) R = s2l('a1 c56 78 d7') L.add('d', '7') # create new set self.assertEqual(d2l(L), R)
def test1(self): L = DictSet(s2d('a1 c5666788')) R = s2l('a1 c56 78') L.add('c', '7') # does nothing to existing set self.assertEqual(d2l(L), R)
def test0(self): L = DictSet(s2d('a1 c5666788')) R = s2l('a1 c56 78 9') L.add('c', '9') # add to existing set self.assertEqual(d2l(L), R)