mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 07:02:24 +00:00
Fix some xml tests
This commit is contained in:
@@ -104,11 +104,7 @@ mod tests {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
report_request,
|
report_request,
|
||||||
ReportRequest::CalendarQuery(CalendarQueryRequest {
|
ReportRequest::CalendarQuery(CalendarQueryRequest {
|
||||||
prop: PropfindType::Prop(PropElement {
|
prop: PropfindType::Prop(PropElement(vec![Propname("getetag".to_owned())])),
|
||||||
prop: vec![Propname {
|
|
||||||
name: "getetag".to_owned()
|
|
||||||
}]
|
|
||||||
}),
|
|
||||||
filter: Some(FilterElement {
|
filter: Some(FilterElement {
|
||||||
comp_filter: CompFilterElement {
|
comp_filter: CompFilterElement {
|
||||||
is_not_defined: None,
|
is_not_defined: None,
|
||||||
|
|||||||
@@ -85,11 +85,9 @@ mod tests {
|
|||||||
ReportRequest::SyncCollection(SyncCollectionRequest {
|
ReportRequest::SyncCollection(SyncCollectionRequest {
|
||||||
sync_token: "".to_owned(),
|
sync_token: "".to_owned(),
|
||||||
sync_level: SyncLevel::One,
|
sync_level: SyncLevel::One,
|
||||||
prop: rustical_dav::xml::PropfindType::Prop(PropElement {
|
prop: rustical_dav::xml::PropfindType::Prop(PropElement(vec![Propname(
|
||||||
prop: vec![Propname {
|
"getetag".to_owned()
|
||||||
name: "getetag".to_owned()
|
)])),
|
||||||
}]
|
|
||||||
}),
|
|
||||||
limit: None
|
limit: None
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ pub struct Propname(#[xml(ty = "tag_name")] pub String);
|
|||||||
|
|
||||||
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
|
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
|
||||||
pub enum PropfindType {
|
pub enum PropfindType {
|
||||||
|
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||||
Propname,
|
Propname,
|
||||||
|
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||||
Allprop,
|
Allprop,
|
||||||
|
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||||
Prop(PropElement),
|
Prop(PropElement),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,16 +53,10 @@ fn propfind_prop() {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
propfind,
|
propfind,
|
||||||
PropfindElement {
|
PropfindElement {
|
||||||
prop: PropfindType::Prop(PropElement {
|
prop: PropfindType::Prop(PropElement(vec![
|
||||||
prop: vec![
|
Propname("displayname".to_owned()),
|
||||||
Propname {
|
Propname("color".to_owned()),
|
||||||
name: "displayname".to_owned()
|
]))
|
||||||
},
|
|
||||||
Propname {
|
|
||||||
name: "color".to_owned()
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user