aboutsummaryrefslogtreecommitdiff
path: root/aerogramme
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-05-26 11:07:24 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-05-26 11:07:24 +0200
commitac528d215646b1d82799fafc4211ade3558074ff (patch)
tree9ff97db305ffb088f38ed6a7e9a873506791b080 /aerogramme
parentd5a222967dbc774ad04cff572a0d901c832b36bf (diff)
downloadaerogramme-ac528d215646b1d82799fafc4211ade3558074ff.tar.gz
aerogramme-ac528d215646b1d82799fafc4211ade3558074ff.zip
test fetching pending VTODOs
Diffstat (limited to 'aerogramme')
-rw-r--r--aerogramme/tests/behavior.rs38
1 files changed, 37 insertions, 1 deletions
diff --git a/aerogramme/tests/behavior.rs b/aerogramme/tests/behavior.rs
index ef58182..7b93d51 100644
--- a/aerogramme/tests/behavior.rs
+++ b/aerogramme/tests/behavior.rs
@@ -917,7 +917,43 @@ fn rfc4791_webdav_caldav() {
);
// 7.8.9. Example: Retrieval of All Pending To-Dos
- // @TODO
+ let cal_query = r#"<?xml version="1.0" encoding="utf-8" ?>
+ <C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
+ <D:prop xmlns:D="DAV:">
+ <D:getetag/>
+ <C:calendar-data/>
+ </D:prop>
+ <C:filter>
+ <C:comp-filter name="VCALENDAR">
+ <C:comp-filter name="VTODO">
+ <C:prop-filter name="COMPLETED">
+ <C:is-not-defined/>
+ </C:prop-filter>
+ <C:prop-filter name="STATUS">
+ <C:text-match negate-condition="yes">CANCELLED</C:text-match>
+ </C:prop-filter>
+ </C:comp-filter>
+ </C:comp-filter>
+ </C:filter>
+ </C:calendar-query>"#;
+ 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::<dav::Multistatus<All>>(&resp.text()?);
+ assert_eq!(multistatus.responses.len(), 1);
+ check_cal(
+ &multistatus,
+ (
+ "/alice/calendar/Personal/rfc6.ics",
+ Some(obj6_etag.to_str().expect("etag header convertible to str")),
+ Some(ICAL_RFC6),
+ ),
+ );
// --- REPORT calendar-query, with calendar-data tx ---
//@FIXME add support for calendar-data...