def test_xdict_key_difference_when_none_present(self): xd = XDict({'one': 1, 'two': 1, 'three': 3}) xn = XDict({'one': 1, 'two': 1, 'three': 3}) self.assertEqual(xd.difference(xn), set([])) # returns empty set
def test_xdict_key_difference(self): xd = XDict({'one': 1, 'two': 1, 'three': 3}) xn = XDict({'one': 1, 'twotwo': 1, 'three': 3}) self.assertEqual(len(xd.difference(xn)), 1) self.assertEqual(xd.difference(xn), set(['two']))