def test_normalize_key_exception(self): a = VDFDict() with self.assertRaises(TypeError): a._normalize_key(5) with self.assertRaises(TypeError): a._normalize_key([]) with self.assertRaises(TypeError): a._normalize_key(None)
def test_normalize_key(self): a = VDFDict() self.assertEqual(a._normalize_key('AAA'), (0, 'AAA')) self.assertEqual(a._normalize_key((5, 'BBB')), (5, 'BBB'))