From db115ca2478af75e9b9bd712cb8592cdd2a62476 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 7 Mar 2024 09:49:09 +0100 Subject: successful multistatus decoding test --- src/dav/decoder.rs | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/src/dav/decoder.rs b/src/dav/decoder.rs index 144cc4e..4acd3e8 100644 --- a/src/dav/decoder.rs +++ b/src/dav/decoder.rs @@ -811,16 +811,52 @@ mod tests { let mut rdr = Reader::new(NsReader::from_reader(src.as_bytes())).await.unwrap(); let got = rdr.find::>>().await.unwrap(); - /*assert_eq!(got, Multistatus { + assert_eq!(got, Multistatus { responses: vec![ Response { - status_or_propstat: + status_or_propstat: StatusOrPropstat::PropStat( + Href("http://www.example.com/container/".into()), + vec![PropStat { + prop: PropName(vec![ + PropertyRequest::CreationDate, + PropertyRequest::DisplayName, + PropertyRequest::ResourceType, + PropertyRequest::SupportedLock, + ]), + status: Status(http::status::StatusCode::OK), + error: None, + responsedescription: None, + }], + ), + error: None, + responsedescription: None, + location: None, + }, + Response { + status_or_propstat: StatusOrPropstat::PropStat( + Href("http://www.example.com/container/front.html".into()), + vec![PropStat { + prop: PropName(vec![ + PropertyRequest::CreationDate, + PropertyRequest::DisplayName, + PropertyRequest::GetContentLength, + PropertyRequest::GetContentType, + PropertyRequest::GetEtag, + PropertyRequest::GetLastModified, + PropertyRequest::ResourceType, + PropertyRequest::SupportedLock, + ]), + status: Status(http::status::StatusCode::OK), + error: None, + responsedescription: None, + }], + ), + error: None, + responsedescription: None, + location: None, }, - Response {}, ], responsedescription: None, - });*/ - + }); } - } -- cgit v1.2.3