(self)
| 359 | self.assertEqual(od.__reduce__()[2], {'x': 10}) |
| 360 | |
| 361 | def test_pickle_recursive(self): |
| 362 | OrderedDict = self.OrderedDict |
| 363 | od = OrderedDict() |
| 364 | od[1] = od |
| 365 | |
| 366 | # pickle directly pulls the module, so we have to fake it |
| 367 | with replaced_module('collections', self.module): |
| 368 | for proto in range(-1, pickle.HIGHEST_PROTOCOL + 1): |
| 369 | dup = pickle.loads(pickle.dumps(od, proto)) |
| 370 | self.assertIsNot(dup, od) |
| 371 | self.assertEqual(list(dup.keys()), [1]) |
| 372 | self.assertIs(dup[1], dup) |
| 373 | |
| 374 | def test_repr(self): |
| 375 | OrderedDict = self.OrderedDict |
nothing calls this directly
no test coverage detected