mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Make assertions a bit narrower again...
and use ownCloud/SabreDAV normalized form for item template instead
This commit is contained in:
parent
3bff81303c
commit
ff688ca2b9
2 changed files with 6 additions and 3 deletions
|
|
@ -1,9 +1,12 @@
|
||||||
def normalize_item(item):
|
def normalize_item(item):
|
||||||
|
# - X-RADICALE-NAME is used by radicale, because hrefs don't really exist
|
||||||
|
# in their filesystem backend
|
||||||
|
# - PRODID is changed by radicale for some reason after upload, but nobody
|
||||||
|
# cares about that anyway
|
||||||
rv = set()
|
rv = set()
|
||||||
for line in item.raw.splitlines():
|
for line in item.raw.splitlines():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
line = line.strip().split(u':', 1)
|
line = line.strip().split(u':', 1)
|
||||||
line[0] = line[0].split(';')[0]
|
|
||||||
if line[0] in ('X-RADICALE-NAME', 'PRODID', 'REV'):
|
if line[0] in ('X-RADICALE-NAME', 'PRODID', 'REV'):
|
||||||
continue
|
continue
|
||||||
rv.add(u':'.join(line))
|
rv.add(u':'.join(line))
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,11 @@ class TestCarddavStorage(DavStorageTests):
|
||||||
u'N:Daboo;Cyrus\n'
|
u'N:Daboo;Cyrus\n'
|
||||||
u'ADR;TYPE=POSTAL:;2822 Email HQ;' # address continuing
|
u'ADR;TYPE=POSTAL:;2822 Email HQ;' # address continuing
|
||||||
u'Suite 2821;RFCVille;PA;15213;USA\n' # on next line
|
u'Suite 2821;RFCVille;PA;15213;USA\n' # on next line
|
||||||
u'EMAIL;TYPE=INTERNET,PREF:cyrus@example.com\n'
|
u'EMAIL;TYPE=INTERNET;TYPE=PREF:cyrus@example.com\n'
|
||||||
u'NICKNAME:me\n'
|
u'NICKNAME:me\n'
|
||||||
u'NOTE:Example VCard.\n'
|
u'NOTE:Example VCard.\n'
|
||||||
u'ORG:Self Employed\n'
|
u'ORG:Self Employed\n'
|
||||||
u'TEL;TYPE=WORK,VOICE:412 605 0499\n'
|
u'TEL;TYPE=WORK;TYPE=VOICE:412 605 0499\n'
|
||||||
u'TEL;TYPE=FAX:412 605 0705\n'
|
u'TEL;TYPE=FAX:412 605 0705\n'
|
||||||
u'URL:http://www.example.com\n'
|
u'URL:http://www.example.com\n'
|
||||||
u'UID:{uid}\n'
|
u'UID:{uid}\n'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue