Skip to content

Commit

Permalink
Fix some xml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lennart-k committed Jan 12, 2025
1 parent a23e52f commit ed84475
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
6 changes: 1 addition & 5 deletions crates/caldav/src/calendar/methods/report/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,7 @@ mod tests {
assert_eq!(
report_request,
ReportRequest::CalendarQuery(CalendarQueryRequest {
prop: PropfindType::Prop(PropElement {
prop: vec![Propname {
name: "getetag".to_owned()
}]
}),
prop: PropfindType::Prop(PropElement(vec![Propname("getetag".to_owned())])),
filter: Some(FilterElement {
comp_filter: CompFilterElement {
is_not_defined: None,
Expand Down
8 changes: 3 additions & 5 deletions crates/carddav/src/addressbook/methods/report/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ mod tests {
ReportRequest::SyncCollection(SyncCollectionRequest {
sync_token: "".to_owned(),
sync_level: SyncLevel::One,
prop: rustical_dav::xml::PropfindType::Prop(PropElement {
prop: vec![Propname {
name: "getetag".to_owned()
}]
}),
prop: rustical_dav::xml::PropfindType::Prop(PropElement(vec![Propname(
"getetag".to_owned()
)])),
limit: None
})
)
Expand Down
3 changes: 3 additions & 0 deletions crates/dav/src/xml/propfind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ pub struct Propname(#[xml(ty = "tag_name")] pub String);

#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
pub enum PropfindType {
#[xml(ns = "crate::namespace::NS_DAV")]
Propname,
#[xml(ns = "crate::namespace::NS_DAV")]
Allprop,
#[xml(ns = "crate::namespace::NS_DAV")]
Prop(PropElement),
}
14 changes: 4 additions & 10 deletions crates/dav/tests/propfind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,10 @@ fn propfind_prop() {
assert_eq!(
propfind,
PropfindElement {
prop: PropfindType::Prop(PropElement {
prop: vec![
Propname {
name: "displayname".to_owned()
},
Propname {
name: "color".to_owned()
},
]
})
prop: PropfindType::Prop(PropElement(vec![
Propname("displayname".to_owned()),
Propname("color".to_owned()),
]))
}
);
}
Expand Down

0 comments on commit ed84475

Please sign in to comment.