Skip to content

Commit

Permalink
more efforts on getting the tests to pass reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
tobixen committed Nov 4, 2024
1 parent 5d24e51 commit 871268c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion tests/compatibility_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
'rate_limited':
"""Pause a bit between each request""",

'cleanup_calendar':
"""Remove everything on the calendar for every test""",

'no_delete_calendar':
"""Not allowed to delete calendars""",
"""Not allowed to delete calendars - or calendar ends up in a 'trashbin'""",

'broken_expand':
"""Server-side expand seems to work, but delivers wrong data (typically missing RECURRENCE-ID)""",
Expand Down
13 changes: 6 additions & 7 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,9 @@ def setup_method(self):
self.caldav = client(**self.server_params)

if self.check_compatibility_flag("rate_limited"):

def delay_decorator(f):
def foo(*a, **kwa):
time.sleep(5)
time.sleep(60)
return f(*a, **kwa)

return foo
Expand Down Expand Up @@ -689,11 +688,11 @@ def _teardownCalendar(self, name=None, cal_id=None):
if self.check_compatibility_flag(
"sticky_events"
) or self.check_compatibility_flag("no_delete_calendar"):
try:
for goo in cal.objects():
for goo in cal.objects():
try:
goo.delete()
except:
pass
except:
pass
cal.delete()
except:
pass
Expand Down Expand Up @@ -2083,7 +2082,7 @@ def testTodoDatesearch(self):
assert len(todos2) == foo

## verify that "expand" works
if not self.check_compatibility_flag("no_recurring"):
if not self.check_compatibility_flag("no_recurring") and not self.check_compatibility_flag("no_recurring_todo"):
## todo1 and todo2 should be the same (todo1 using legacy method)
## todo1 and todo2 tries doing server side expand, with fallback
## to client side expand
Expand Down

0 comments on commit 871268c

Please sign in to comment.