(self)
| 1019 | type, "ConfusedGrid", (HVGrid, VHGrid), {}) |
| 1020 | |
| 1021 | def test_object_class(self): |
| 1022 | # Testing object class... |
| 1023 | a = object() |
| 1024 | self.assertEqual(a.__class__, object) |
| 1025 | self.assertEqual(type(a), object) |
| 1026 | b = object() |
| 1027 | self.assertNotEqual(a, b) |
| 1028 | self.assertNotHasAttr(a, "foo") |
| 1029 | try: |
| 1030 | a.foo = 12 |
| 1031 | except (AttributeError, TypeError): |
| 1032 | pass |
| 1033 | else: |
| 1034 | self.fail("object() should not allow setting a foo attribute") |
| 1035 | self.assertNotHasAttr(object(), "__dict__") |
| 1036 | |
| 1037 | class Cdict(object): |
| 1038 | pass |
| 1039 | x = Cdict() |
| 1040 | self.assertEqual(x.__dict__, {}) |
| 1041 | x.foo = 1 |
| 1042 | self.assertEqual(x.foo, 1) |
| 1043 | self.assertEqual(x.__dict__, {'foo': 1}) |
| 1044 | |
| 1045 | def test_object_class_assignment_between_heaptypes_and_nonheaptypes(self): |
| 1046 | class SubType(types.ModuleType): |
nothing calls this directly
no test coverage detected