@@ -1526,6 +1526,7 @@ def test_report_sync_collection_invalid_sync_token(self) -> None:
1526
1526
assert not sync_token
1527
1527
1528
1528
def test_report_with_expand_property (self ) -> None :
1529
+ """Test report with expand property"""
1529
1530
self .put ("/calendar.ics/" , get_file_content ("event_daily_rrule.ics" ))
1530
1531
req_body_without_expand = \
1531
1532
"""<?xml version="1.0" encoding="utf-8" ?>
@@ -1546,21 +1547,22 @@ def test_report_with_expand_property(self) -> None:
1546
1547
_ , responses = self .report ("/calendar.ics/" , req_body_without_expand )
1547
1548
assert len (responses ) == 1
1548
1549
1549
- response = responses ['/calendar.ics/event_daily_rrule.ics' ]
1550
- status , element = list (response .values ())[0 ]
1550
+ response_without_expand = responses ['/calendar.ics/event_daily_rrule.ics' ]
1551
+ assert not isinstance (response_without_expand , int )
1552
+ status , element = response_without_expand ["C:calendar-data" ]
1551
1553
1552
- assert status == 200
1554
+ assert status == 200 and element . text
1553
1555
1554
1556
assert "RRULE" in element .text
1555
1557
assert "BEGIN:VTIMEZONE" in element .text
1556
1558
assert "RECURRENCE-ID" not in element .text
1557
1559
1558
- uids = []
1560
+ uids : List [ str ] = []
1559
1561
for line in element .text .split ("\n " ):
1560
1562
if line .startswith ("UID:" ):
1561
1563
uid = line [len ("UID:" ):]
1562
1564
assert uid == "event_daily_rrule"
1563
- uids .append (uids )
1565
+ uids .append (uid )
1564
1566
1565
1567
assert len (uids ) == 1
1566
1568
@@ -1586,10 +1588,11 @@ def test_report_with_expand_property(self) -> None:
1586
1588
1587
1589
assert len (responses ) == 1
1588
1590
1589
- response = responses ['/calendar.ics/event_daily_rrule.ics' ]
1590
- status , element = list (response .values ())[0 ]
1591
+ response_with_expand = responses ['/calendar.ics/event_daily_rrule.ics' ]
1592
+ assert not isinstance (response_with_expand , int )
1593
+ status , element = response_with_expand ["C:calendar-data" ]
1591
1594
1592
- assert status == 200
1595
+ assert status == 200 and element . text
1593
1596
assert "RRULE" not in element .text
1594
1597
assert "BEGIN:VTIMEZONE" not in element .text
1595
1598
@@ -1598,7 +1601,7 @@ def test_report_with_expand_property(self) -> None:
1598
1601
for line in element .text .split ("\n " ):
1599
1602
if line .startswith ("UID:" ):
1600
1603
assert line == "UID:event_daily_rrule"
1601
- uids .append (uids )
1604
+ uids .append (line )
1602
1605
1603
1606
if line .startswith ("RECURRENCE-ID:" ):
1604
1607
recurrence_ids .append (line )
0 commit comments