MCPcopy Index your code
hub / github.com/python/cpython / test_multiple_inheritance_mapping

Method test_multiple_inheritance_mapping

Lib/test/test_patma.py:46–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 return "seq"
45
46 def test_multiple_inheritance_mapping(self):
47 class C:
48 pass
49 class M1(collections.UserDict, collections.abc.Sequence):
50 pass
51 class M2(C, collections.UserDict, collections.abc.Sequence):
52 pass
53 class M3(collections.UserDict, C, list):
54 pass
55 class M4(dict, collections.abc.Sequence, C):
56 pass
57 self.assertEqual(self.check_sequence_then_mapping(M1()), "map")
58 self.assertEqual(self.check_sequence_then_mapping(M2()), "map")
59 self.assertEqual(self.check_sequence_then_mapping(M3()), "map")
60 self.assertEqual(self.check_sequence_then_mapping(M4()), "map")
61 self.assertEqual(self.check_mapping_then_sequence(M1()), "map")
62 self.assertEqual(self.check_mapping_then_sequence(M2()), "map")
63 self.assertEqual(self.check_mapping_then_sequence(M3()), "map")
64 self.assertEqual(self.check_mapping_then_sequence(M4()), "map")
65
66 def test_multiple_inheritance_sequence(self):
67 class C:

Callers

nothing calls this directly

Calls 7

M3Class · 0.85
M4Class · 0.85
M1Class · 0.70
M2Class · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected