(self)
| 2040 | self.assertEqual(foo(), 0) |
| 2041 | |
| 2042 | def test_patch_orderdict(self): |
| 2043 | foo = OrderedDict() |
| 2044 | foo['a'] = object() |
| 2045 | foo['b'] = 'python' |
| 2046 | |
| 2047 | original = foo.copy() |
| 2048 | update_values = list(zip('cdefghijklmnopqrstuvwxyz', range(26))) |
| 2049 | patched_values = list(foo.items()) + update_values |
| 2050 | |
| 2051 | with patch.dict(foo, OrderedDict(update_values)): |
| 2052 | self.assertEqual(list(foo.items()), patched_values) |
| 2053 | |
| 2054 | self.assertEqual(foo, original) |
| 2055 | |
| 2056 | with patch.dict(foo, update_values): |
| 2057 | self.assertEqual(list(foo.items()), patched_values) |
| 2058 | |
| 2059 | self.assertEqual(foo, original) |
| 2060 | |
| 2061 | def test_dotted_but_module_not_loaded(self): |
| 2062 | # This exercises the AttributeError branch of _dot_lookup. |
nothing calls this directly
no test coverage detected