(monkeypatch)
| 21 | |
| 22 | |
| 23 | def test_basic(monkeypatch): |
| 24 | a = MemoryStorage() |
| 25 | b = MemoryStorage() |
| 26 | status = {} |
| 27 | |
| 28 | a.set_meta('foo', 'bar') |
| 29 | metasync(a, b, status, keys=['foo']) |
| 30 | assert a.get_meta('foo') == b.get_meta('foo') == 'bar' |
| 31 | |
| 32 | a.set_meta('foo', 'baz') |
| 33 | metasync(a, b, status, keys=['foo']) |
| 34 | assert a.get_meta('foo') == b.get_meta('foo') == 'baz' |
| 35 | |
| 36 | monkeypatch.setattr(a, 'set_meta', blow_up) |
| 37 | monkeypatch.setattr(b, 'set_meta', blow_up) |
| 38 | metasync(a, b, status, keys=['foo']) |
| 39 | assert a.get_meta('foo') == b.get_meta('foo') == 'baz' |
| 40 | monkeypatch.undo() |
| 41 | monkeypatch.undo() |
| 42 | |
| 43 | b.set_meta('foo', None) |
| 44 | metasync(a, b, status, keys=['foo']) |
| 45 | assert not a.get_meta('foo') and not b.get_meta('foo') |
| 46 | |
| 47 | |
| 48 | @pytest.fixture |
nothing calls this directly
no test coverage detected