diff options
Diffstat (limited to 'Lib/test/test_dictviews.py')
-rw-r--r-- | Lib/test/test_dictviews.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py index ac8bfe6..7b02ea9 100644 --- a/Lib/test/test_dictviews.py +++ b/Lib/test/test_dictviews.py @@ -112,6 +112,13 @@ class DictSetTest(unittest.TestCase): self.assertEqual(d1.keys() ^ set(d3.keys()), {'a', 'b', 'd', 'e'}) + self.assertEqual(d1.keys() - d1.keys(), set()) + self.assertEqual(d1.keys() - d2.keys(), {'a'}) + self.assertEqual(d1.keys() - d3.keys(), {'a', 'b'}) + self.assertEqual(d1.keys() - set(d1.keys()), set()) + self.assertEqual(d1.keys() - set(d2.keys()), {'a'}) + self.assertEqual(d1.keys() - set(d3.keys()), {'a', 'b'}) + self.assertFalse(d1.keys().isdisjoint(d1.keys())) self.assertFalse(d1.keys().isdisjoint(d2.keys())) self.assertFalse(d1.keys().isdisjoint(list(d2.keys()))) @@ -162,6 +169,13 @@ class DictSetTest(unittest.TestCase): self.assertEqual(d1.items() ^ d3.items(), {('a', 1), ('b', 2), ('d', 4), ('e', 5)}) + self.assertEqual(d1.items() - d1.items(), set()) + self.assertEqual(d1.items() - d2.items(), {('a', 1)}) + self.assertEqual(d1.items() - d3.items(), {('a', 1), ('b', 2)}) + self.assertEqual(d1.items() - set(d1.items()), set()) + self.assertEqual(d1.items() - set(d2.items()), {('a', 1)}) + self.assertEqual(d1.items() - set(d3.items()), {('a', 1), ('b', 2)}) + self.assertFalse(d1.items().isdisjoint(d1.items())) self.assertFalse(d1.items().isdisjoint(d2.items())) self.assertFalse(d1.items().isdisjoint(list(d2.items()))) |