mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Add test for partial_sync=ignore
This commit is contained in:
parent
ff7586fc40
commit
2e3ebd814a
1 changed files with 27 additions and 0 deletions
|
|
@ -96,6 +96,33 @@ def test_partial_sync_ignore():
|
|||
assert not list(b.list())
|
||||
|
||||
|
||||
def test_ignore_partial_sync():
|
||||
def items(s):
|
||||
return set(x[1].raw for x in s.items.values())
|
||||
|
||||
a = MemoryStorage()
|
||||
b = MemoryStorage()
|
||||
status = {}
|
||||
|
||||
href, etag = a.upload(Item('UID:0'))
|
||||
a.read_only = True
|
||||
|
||||
sync(a, b, status, partial_sync='ignore', force_delete=True)
|
||||
assert items(b) == items(a) == {'UID:0'}
|
||||
|
||||
b.items.clear()
|
||||
sync(a, b, status, partial_sync='ignore', force_delete=True)
|
||||
sync(a, b, status, partial_sync='ignore', force_delete=True)
|
||||
assert items(a) == {'UID:0'}
|
||||
assert not b.items
|
||||
|
||||
a.read_only = False
|
||||
a.update(href, Item('UID:0\nupdated'), etag)
|
||||
a.read_only = True
|
||||
sync(a, b, status, partial_sync='ignore', force_delete=True)
|
||||
assert items(b) == items(a) == {'UID:0\nupdated'}
|
||||
|
||||
|
||||
def test_upload_and_update():
|
||||
a = MemoryStorage(fileext='.a')
|
||||
b = MemoryStorage(fileext='.b')
|
||||
|
|
|
|||
Loading…
Reference in a new issue