(self)
| 439 | # CRASHES dict_next(NULL, 0) |
| 440 | |
| 441 | def test_dict_update(self): |
| 442 | # Test PyDict_Update() |
| 443 | update = _testlimitedcapi.dict_update |
| 444 | for cls1 in DICT_TYPES: |
| 445 | for cls2 in ANYDICT_TYPES + MAPPING_TYPES: |
| 446 | dct = cls1({'a': 1, 'b': 2}) |
| 447 | update(dct, cls2({'b': 3, 'c': 4})) |
| 448 | self.assertEqual(dct, {'a': 1, 'b': 3, 'c': 4}) |
| 449 | |
| 450 | self.assertRaises(AttributeError, update, {}, []) |
| 451 | self.assertRaises(AttributeError, update, {}, 42) |
| 452 | for test_type in FROZENDICT_TYPES: |
| 453 | with self.frozendict_does_not_support('assignment'): |
| 454 | update(test_type(), {}) |
| 455 | for test_type in MAPPING_TYPES + OTHER_TYPES: |
| 456 | self.assertRaises(SystemError, update, test_type(), {}) |
| 457 | self.assertRaises(SystemError, update, {}, NULL) |
| 458 | self.assertRaises(SystemError, update, NULL, {}) |
| 459 | |
| 460 | def test_dict_merge(self): |
| 461 | # Test PyDict_Merge() |
nothing calls this directly
no test coverage detected