(self)
| 1759 | self.assertIs(v, weakdict.get(k)) |
| 1760 | |
| 1761 | def test_weak_valued_dict_update(self): |
| 1762 | self.check_update(weakref.WeakValueDictionary, |
| 1763 | {1: C(), 'a': C(), C(): C()}) |
| 1764 | # errors |
| 1765 | self.assertRaises(TypeError, weakref.WeakValueDictionary.update) |
| 1766 | d = weakref.WeakValueDictionary() |
| 1767 | self.assertRaises(TypeError, d.update, {}, {}) |
| 1768 | self.assertRaises(TypeError, d.update, (), ()) |
| 1769 | self.assertEqual(list(d.keys()), []) |
| 1770 | # special keyword arguments |
| 1771 | o = Object(3) |
| 1772 | for kw in 'self', 'dict', 'other', 'iterable': |
| 1773 | d = weakref.WeakValueDictionary() |
| 1774 | d.update(**{kw: o}) |
| 1775 | self.assertEqual(list(d.keys()), [kw]) |
| 1776 | self.assertEqual(d[kw], o) |
| 1777 | |
| 1778 | def test_weak_valued_union_operators(self): |
| 1779 | a = C() |
nothing calls this directly
no test coverage detected