From 418adf92be86ea83008a145180837f1e0ad3018a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 27 May 2024 08:03:21 +0200 Subject: debug support of calendar-data pruning --- aerogramme/tests/behavior.rs | 50 +++++++++++++++++++++++++++++++++++- aerogramme/tests/common/constants.rs | 28 ++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) (limited to 'aerogramme') diff --git a/aerogramme/tests/behavior.rs b/aerogramme/tests/behavior.rs index 7b93d51..c88583f 100644 --- a/aerogramme/tests/behavior.rs +++ b/aerogramme/tests/behavior.rs @@ -956,7 +956,55 @@ fn rfc4791_webdav_caldav() { ); // --- REPORT calendar-query, with calendar-data tx --- - //@FIXME add support for calendar-data... + let cal_query = r#" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "#; + + let resp = http + .request( + reqwest::Method::from_bytes(b"REPORT")?, + "http://localhost:8087/alice/calendar/Personal/", + ) + .body(cal_query) + .send()?; + assert_eq!(resp.status(), 207); + let multistatus = dav_deserialize::>(&resp.text()?); + assert_eq!(multistatus.responses.len(), 1); + check_cal( + &multistatus, + ( + "/alice/calendar/Personal/rfc3.ics", + Some(obj3_etag.to_str().expect("etag header convertible to str")), + Some(ICAL_RFC3_STRIPPED), + ), + ); Ok(()) }) diff --git a/aerogramme/tests/common/constants.rs b/aerogramme/tests/common/constants.rs index c04bae0..16daec6 100644 --- a/aerogramme/tests/common/constants.rs +++ b/aerogramme/tests/common/constants.rs @@ -125,6 +125,34 @@ END:VEVENT END:VCALENDAR "; +pub static ICAL_RFC3_STRIPPED: &[u8] = b"BEGIN:VCALENDAR\r +VERSION:2.0\r +BEGIN:VTIMEZONE\r +LAST-MODIFIED:20040110T032845Z\r +TZID:US/Eastern\r +BEGIN:DAYLIGHT\r +DTSTART:20000404T020000\r +RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4\r +TZNAME:EDT\r +TZOFFSETFROM:-0500\r +TZOFFSETTO:-0400\r +END:DAYLIGHT\r +BEGIN:STANDARD\r +DTSTART:20001026T020000\r +RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10\r +TZNAME:EST\r +TZOFFSETFROM:-0400\r +TZOFFSETTO:-0500\r +END:STANDARD\r +END:VTIMEZONE\r +BEGIN:VEVENT\r +DTSTART;TZID=US/Eastern:20060104T100000\r +DURATION:PT1H\r +UID:DC6C50A017428C5216A2F1CD@example.com\r +END:VEVENT\r +END:VCALENDAR\r +"; + pub static ICAL_RFC4: &[u8] = br#"BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN -- cgit v1.2.3