Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tobixen committed Dec 5, 2024
1 parent 2a44b12 commit 5f6dc38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
21 changes: 17 additions & 4 deletions check_server_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def _debugger():


def _delay_decorator(f, delay=10):
"""
Sometimes we need to pause between each request, i.e. due to servers
that queues up work, rate-limits requests, etc.
"""
def foo(*a, **kwa):
time.sleep(delay)
return f(*a, **kwa)
Expand All @@ -93,6 +97,12 @@ def foo(*a, **kwa):


class ServerQuirkChecker:
"""
This class will ...
* Keep the connection details to the server
* Keep the state of what's already checked
*
"""
def __init__(self, client_obj):
self.client_obj = client_obj
self.flags_checked = {}
Expand Down Expand Up @@ -557,13 +567,16 @@ def _check_simple_events(self, obj1, obj2):
elif len(events) == 0:
self.set_flag("text_search_is_exact_match_only", "maybe")
## may also be text_search_is_exact_match_sometimes
events = cal.search(
events1 = cal.search(
summary="Test event 1", class_="CONFIDENTIAL", event=True
)
if len(events) == 1:
## I don't expect this program to be in use by 2055.
events2 = cal.search(
start=datetime(2000,1,1), end=datetime(2055,1,1), class_="CONFIDENTIAL", event=True
)
if len(events1) == 1 and len(events2) == 1:
self.set_flag("combined_search_not_working", False)
elif len(events) == 0:
_debugger()
elif len(events1 + events2) in (0,1,3):
self.set_flag("combined_search_not_working", True)
else:
_debugger()
Expand Down
9 changes: 8 additions & 1 deletion tests/compatibility_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,11 @@
#'nofreebusy', ## for old versions
'fragile_sync_tokens', ## no issue raised yet
'vtodo_datesearch_nodtstart_task_is_skipped', ## no issue raised yet
'broken_expand_on_exceptions',
'broken_expand_on_exceptions', ## no issue raised yet
'date_todo_search_ignores_duration'
'calendar_color',
'calendar_order',
'vtodo_datesearch_notime_task_is_skipped'
]

google = [
Expand Down Expand Up @@ -410,6 +414,9 @@
'no_recurring_todo',
'combined_search_not_working',
'text_search_is_exact_match_sometimes',
'search_needs_comptype',
'calendar_color',
'calendar_order'
]

fastmail = [
Expand Down

0 comments on commit 5f6dc38

Please sign in to comment.