]> granicus.if.org Git - python/commitdiff
Expand scope to include general mapping protocol tests.
authorRaymond Hettinger <python@rcn.com>
Thu, 30 Sep 2004 15:07:29 +0000 (15:07 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 30 Sep 2004 15:07:29 +0000 (15:07 +0000)
Many of these tests are redundant, but this will ensure
that the mapping protocols all stay in sync.
Also, added a test for dictionary subclasses.

Lib/test/test_dict.py

index e05e734ac665b6d232690ec11d0ec1beb107e34f..e13829caec9dfdbe5db63293665bb36dcade294c 100644 (file)
@@ -395,9 +395,22 @@ class DictTest(unittest.TestCase):
         else:
             self.fail("< didn't raise Exc")
 
+import mapping_tests
+
+class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
+    type2test = dict
+
+class Dict(dict):
+    pass
+
+class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
+    type2test = Dict
+
 def test_main():
     test_support.run_unittest(
         DictTest,
+        GeneralMappingTests,
+        SubclassMappingTests,
     )
 
 if __name__ == "__main__":