mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
More tests
This commit is contained in:
parent
0f2e7e2395
commit
7ab6de6f37
1 changed files with 13 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import pytest
|
||||||
|
|
||||||
from tests import uid_strategy
|
from tests import uid_strategy
|
||||||
|
|
||||||
from vdirsyncer.repair import repair_item, repair_storage
|
from vdirsyncer.repair import IrreparableItem, repair_item, repair_storage
|
||||||
from vdirsyncer.storage.memory import MemoryStorage
|
from vdirsyncer.storage.memory import MemoryStorage
|
||||||
from vdirsyncer.utils import href_safe
|
from vdirsyncer.utils import href_safe
|
||||||
from vdirsyncer.utils.vobject import Item
|
from vdirsyncer.utils.vobject import Item
|
||||||
|
|
@ -67,3 +67,15 @@ def test_repair_do_nothing():
|
||||||
item = Item('BEGIN:VCARD\nUID:justfine\nEND:VCARD')
|
item = Item('BEGIN:VCARD\nUID:justfine\nEND:VCARD')
|
||||||
assert repair_item('fine', item, set(), True) is item
|
assert repair_item('fine', item, set(), True) is item
|
||||||
assert repair_item('@@@@/fine', item, set(), True) is item
|
assert repair_item('@@@@/fine', item, set(), True) is item
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('raw', [
|
||||||
|
'AYYY',
|
||||||
|
'',
|
||||||
|
'@@@@',
|
||||||
|
'BEGIN:VCARD',
|
||||||
|
'BEGIN:FOO\nEND:FOO'
|
||||||
|
])
|
||||||
|
def test_repair_irreparable(raw):
|
||||||
|
with pytest.raises(IrreparableItem):
|
||||||
|
repair_item('fine', Item(raw), set(), True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue