(self)
| 2523 | self.assertEqual(sorted(d.items()), [(i, chr(i)) for i in indices]) |
| 2524 | |
| 2525 | def test_dict_iter(self): |
| 2526 | d = self.dict() |
| 2527 | indices = list(range(65, 70)) |
| 2528 | for i in indices: |
| 2529 | d[i] = chr(i) |
| 2530 | it = iter(d) |
| 2531 | self.assertEqual(list(it), indices) |
| 2532 | self.assertEqual(list(it), []) # exhausted |
| 2533 | # dictionary changed size during iteration |
| 2534 | it = iter(d) |
| 2535 | d.clear() |
| 2536 | self.assertRaises(RuntimeError, next, it) |
| 2537 | |
| 2538 | def test_dict_proxy_nested(self): |
| 2539 | pets = self.dict(ferrets=2, hamsters=4) |
nothing calls this directly
no test coverage detected