vdirsyncer/tests/__init__.py
Markus Unterwaditzer ff688ca2b9 Make assertions a bit narrower again...
and use ownCloud/SabreDAV normalized form for item template instead
2014-03-19 16:03:57 +01:00

17 lines
585 B
Python

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()
for line in item.raw.splitlines():
line = line.strip()
line = line.strip().split(u':', 1)
if line[0] in ('X-RADICALE-NAME', 'PRODID', 'REV'):
continue
rv.add(u':'.join(line))
return rv
def assert_item_equals(a, b):
assert normalize_item(a) == normalize_item(b)