Skip to content

Commit 608accf

Browse files
committed
fixup! chore: deal with code review concerns
AI Prompts: claude-sonnet-4-6: pytest tests/test_caldav_unit.py::TestAsyncGetObjectByUid::test_get_object_by_uid_returns_coroutine_for_async_client got broken in 47aea03 claude-sonnet-4-6: pytest tests/test_caldav_unit.py::TestAsyncGetObjectByUid::test_get_object_by_uid_returns_coroutine_for_async_client got broken in 47aea03
1 parent 12e036c commit 608accf

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

tests/test_caldav_unit.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,10 +1995,7 @@ def test_get_object_by_uid_returns_coroutine_for_async_client(self):
19951995

19961996
xml_response = self._make_multistatus(ev1)
19971997
client = MockedDAVClient(xml_response)
1998-
# Pretend the client is async by patching the type name
1999-
client.__class__ = type(
2000-
"AsyncDAVClient", (MockedDAVClient,), {"__module__": AsyncDAVClient.__module__}
2001-
)
1998+
client.__class__ = type("MockedAsyncDAVClient", (MockedDAVClient, AsyncDAVClient), {})
20021999
calendar = Calendar(client, url="/calendar/")
20032000
assert calendar.is_async_client
20042001
uid = "20010712T182145Z-123401@example.com"
@@ -2016,9 +2013,7 @@ def test_get_object_by_uid_async_returns_correct_object(self):
20162013
from caldav.async_davclient import AsyncDAVClient
20172014

20182015
client = MockedDAVClient("")
2019-
client.__class__ = type(
2020-
"AsyncDAVClient", (MockedDAVClient,), {"__module__": AsyncDAVClient.__module__}
2021-
)
2016+
client.__class__ = type("MockedAsyncDAVClient", (MockedDAVClient, AsyncDAVClient), {})
20222017
calendar = Calendar(client, url="/calendar/")
20232018
uid = "20010712T182145Z-123401@example.com"
20242019

@@ -2072,9 +2067,7 @@ def _make_async_client_and_calendar(self):
20722067
from caldav.async_davclient import AsyncDAVClient
20732068

20742069
client = MockedDAVClient("")
2075-
client.__class__ = type(
2076-
"AsyncDAVClient", (MockedDAVClient,), {"__module__": AsyncDAVClient.__module__}
2077-
)
2070+
client.__class__ = type("MockedAsyncDAVClient", (MockedDAVClient, AsyncDAVClient), {})
20782071
calendar = Calendar(client, url="/calendar/")
20792072
return client, calendar
20802073

0 commit comments

Comments
 (0)