1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-10 18:40:53 +00:00

Fix for free-busy fbtype statuses

This commit is contained in:
Ray 2023-12-09 18:22:03 -07:00
parent 204623d656
commit 29b7cd8d54
5 changed files with 50 additions and 6 deletions

View file

@ -1369,7 +1369,7 @@ permissions: RrWw""")
"""Test free busy report on a few items"""
calendar_path = "/calendar.ics/"
self.mkcalendar(calendar_path)
for i in (1,2):
for i in (1,2,10):
filename = "event{}.ics".format(i)
event = get_file_content(filename)
self.put(posixpath.join(calendar_path, filename), event)
@ -1382,9 +1382,13 @@ permissions: RrWw""")
assert isinstance(response, vobject.base.Component)
assert len(responses) == 1
vcalendar = list(responses.values())[0]
assert len(vcalendar.vfreebusy_list) == 2
assert len(vcalendar.vfreebusy_list) == 3
types = {}
for vfb in vcalendar.vfreebusy_list:
assert vfb.fbtype.value == 'BUSY'
if vfb.fbtype.value not in types:
types[vfb.fbtype.value] = 0
types[vfb.fbtype.value] += 1
assert types == {'BUSY':2, 'FREE':1}
def _report_sync_token(
self, calendar_path: str, sync_token: Optional[str] = None