From a7da8ddd4b395eba2e147688d864bf566a756e8f Mon Sep 17 00:00:00 2001 From: TowyTowy Date: Mon, 13 Jul 2026 13:00:41 +0200 Subject: [PATCH] tests: guard REPORT response type to satisfy mypy Assert the response is a dict before indexing, matching the existing pattern used elsewhere in test_expand.py, so the Lint (mypy) job passes. Co-Authored-By: Claude --- radicale/tests/test_expand.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/radicale/tests/test_expand.py b/radicale/tests/test_expand.py index e6c7d06f..d4bf0b72 100644 --- a/radicale/tests/test_expand.py +++ b/radicale/tests/test_expand.py @@ -766,8 +766,9 @@ permissions: RrWw""") # Baseline (no expand): the stored event still holds RRULE and RDATE. _, responses = self.report( "/calendar.ics/", self._req_without_expand(uid, start, end)) - status, element = responses[ - f"/calendar.ics/{uid}.ics"]["C:calendar-data"] + response = responses[f"/calendar.ics/{uid}.ics"] + assert isinstance(response, dict) + status, element = response["C:calendar-data"] assert status == 200 and element.text assert "RRULE" in element.text assert "RDATE" in element.text @@ -775,8 +776,9 @@ permissions: RrWw""") # Expanded: individual instances must not carry recurrence properties. _, responses = self.report( "/calendar.ics/", self._req_with_expand(uid, start, end)) - status, element = responses[ - f"/calendar.ics/{uid}.ics"]["C:calendar-data"] + response = responses[f"/calendar.ics/{uid}.ics"] + assert isinstance(response, dict) + status, element = response["C:calendar-data"] assert status == 200 and element.text assert "RECURRENCE-ID" in element.text assert "RRULE" not in element.text