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 <noreply@anthropic.com>
This commit is contained in:
TowyTowy
2026-07-13 13:00:41 +02:00
parent 9d46d5b63d
commit a7da8ddd4b

View File

@@ -766,8 +766,9 @@ permissions: RrWw""")
# Baseline (no expand): the stored event still holds RRULE and RDATE. # Baseline (no expand): the stored event still holds RRULE and RDATE.
_, responses = self.report( _, responses = self.report(
"/calendar.ics/", self._req_without_expand(uid, start, end)) "/calendar.ics/", self._req_without_expand(uid, start, end))
status, element = responses[ response = responses[f"/calendar.ics/{uid}.ics"]
f"/calendar.ics/{uid}.ics"]["C:calendar-data"] assert isinstance(response, dict)
status, element = response["C:calendar-data"]
assert status == 200 and element.text assert status == 200 and element.text
assert "RRULE" in element.text assert "RRULE" in element.text
assert "RDATE" in element.text assert "RDATE" in element.text
@@ -775,8 +776,9 @@ permissions: RrWw""")
# Expanded: individual instances must not carry recurrence properties. # Expanded: individual instances must not carry recurrence properties.
_, responses = self.report( _, responses = self.report(
"/calendar.ics/", self._req_with_expand(uid, start, end)) "/calendar.ics/", self._req_with_expand(uid, start, end))
status, element = responses[ response = responses[f"/calendar.ics/{uid}.ics"]
f"/calendar.ics/{uid}.ics"]["C:calendar-data"] assert isinstance(response, dict)
status, element = response["C:calendar-data"]
assert status == 200 and element.text assert status == 200 and element.text
assert "RECURRENCE-ID" in element.text assert "RECURRENCE-ID" in element.text
assert "RRULE" not in element.text assert "RRULE" not in element.text