MCPcopy
hub / github.com/pimutils/vdirsyncer / test_conflict_x_wins

Function test_conflict_x_wins

tests/unit/test_metasync.py:106–118  ·  view source on GitHub ↗
(wins)

Source from the content-addressed store, hash-verified

104
105@pytest.mark.parametrize('wins', 'ab')
106def test_conflict_x_wins(wins):
107 a = MemoryStorage()
108 b = MemoryStorage()
109 status = {}
110 a.set_meta('foo', 'bar')
111 b.set_meta('foo', 'baz')
112
113 metasync(a, b, status, keys=['foo'],
114 conflict_resolution='a wins' if wins == 'a' else 'b wins')
115
116 assert a.get_meta('foo') == b.get_meta('foo') == status['foo'] == (
117 'bar' if wins == 'a' else 'baz'
118 )
119
120
121keys = st.text(min_size=1).filter(lambda x: x.strip() == x)

Callers

nothing calls this directly

Calls 4

set_metaMethod · 0.95
get_metaMethod · 0.95
MemoryStorageClass · 0.90
metasyncFunction · 0.90

Tested by

no test coverage detected