mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Add another test related to vcards vs icalendar
This commit is contained in:
parent
dea468fcaa
commit
e2fa26a711
1 changed files with 20 additions and 0 deletions
|
|
@ -195,3 +195,23 @@ def test_vcard_property_groups():
|
||||||
|
|
||||||
assert vobject.Item(vcard).hash == vobject.Item(splitted[0]).hash
|
assert vobject.Item(vcard).hash == vobject.Item(splitted[0]).hash
|
||||||
assert 'is the Address' in vobject.Item(vcard).parsed['MYLABEL123.ADR']
|
assert 'is the Address' in vobject.Item(vcard).parsed['MYLABEL123.ADR']
|
||||||
|
|
||||||
|
|
||||||
|
def test_vcard_semicolons_in_values():
|
||||||
|
# If this test fails because proper vCard support was added to icalendar,
|
||||||
|
# we can remove some ugly postprocessing code in to_unicode_lines.
|
||||||
|
|
||||||
|
vcard = textwrap.dedent(u'''
|
||||||
|
BEGIN:VCARD
|
||||||
|
VERSION:3.0
|
||||||
|
ADR:;;Address 08;City;;12345;Germany
|
||||||
|
END:VCARD
|
||||||
|
''').strip()
|
||||||
|
|
||||||
|
# Assert that icalendar breaks vcard properties with semicolons in values
|
||||||
|
assert 'ADR:\\;\\;Address 08\\;City\\;\\;12345\\;Germany' in \
|
||||||
|
vobject.Item(vcard).parsed.to_ical()
|
||||||
|
|
||||||
|
# Assert that vdirsyncer fixes these properties
|
||||||
|
assert 'ADR:;;Address 08;City;;12345;Germany' in \
|
||||||
|
list(vobject.to_unicode_lines(vobject.Item(vcard).parsed))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue