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

Function test_deletion

tests/unit/sync/test_sync.py:174–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173
174def test_deletion():
175 a = MemoryStorage(fileext='.a')
176 b = MemoryStorage(fileext='.b')
177 status = {}
178
179 item = Item('UID:1')
180 a.upload(item)
181 item2 = Item('UID:2')
182 a.upload(item2)
183 sync(a, b, status)
184 b.delete('1.b', b.get('1.b')[1])
185 sync(a, b, status)
186 assert items(a) == items(b) == {item2.raw}
187
188 a.upload(item)
189 sync(a, b, status)
190 assert items(a) == items(b) == {item.raw, item2.raw}
191 a.delete('1.a', a.get('1.a')[1])
192 sync(a, b, status)
193 assert items(a) == items(b) == {item2.raw}
194
195
196def test_insert_hash():

Callers

nothing calls this directly

Calls 7

uploadMethod · 0.95
deleteMethod · 0.95
getMethod · 0.95
MemoryStorageClass · 0.90
ItemClass · 0.90
itemsFunction · 0.85
syncFunction · 0.70

Tested by

no test coverage detected