diff options
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r-- | Lib/test/test_dict.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 8984334..919fce8 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -35,7 +35,9 @@ class DictTest(unittest.TestCase): d = {'a': 1, 'b': 2} k = d.keys() self.assertTrue('a' in d) + self.assertIn('a', d) self.assertTrue('b' in d) + self.assertIn('b', d) self.assertRaises(TypeError, d.keys, None) self.assertEqual(repr(dict(a=1).keys()), "dict_keys(['a'])") @@ -60,10 +62,14 @@ class DictTest(unittest.TestCase): d = {} self.assertTrue(not ('a' in d)) self.assertTrue('a' not in d) + self.assertNotIn('a', d) d = {'a': 1, 'b': 2} self.assertTrue('a' in d) + self.assertIn('a', d) self.assertTrue('b' in d) + self.assertIn('b', d) self.assertTrue('c' not in d) + self.assertNotIn('c', d) self.assertRaises(TypeError, d.__contains__) @@ -519,7 +525,9 @@ class DictTest(unittest.TestCase): self.assertEqual(d[1], 2) self.assertEqual(d[3], 4) self.assertTrue(2 not in d) + self.assertNotIn(2, d) self.assertTrue(2 not in d.keys()) + self.assertNotIn(2, d.keys()) self.assertEqual(d[2], 42) class E(dict): def __missing__(self, key): |