Still testing CalDAV
This commit is contained in:
parent
4276090314
commit
e127ebeaa9
2 changed files with 32 additions and 1 deletions
|
@ -389,7 +389,7 @@ impl<C: CalContext> QuickWritable<C> for CalendarDataEmpty {
|
|||
|
||||
impl<C: CalContext> QuickWritable<C> for Comp {
|
||||
async fn write(&self, xml: &mut Writer<impl AsyncWrite+Unpin>, ctx: C) -> Result<(), QError> {
|
||||
let mut start = ctx.create_cal_element("calendar-data");
|
||||
let mut start = ctx.create_cal_element("comp");
|
||||
start.push_attribute(("name", self.name.as_str()));
|
||||
let end = start.to_end();
|
||||
xml.write_event_async(Event::Start(start.clone())).await?;
|
||||
|
@ -713,6 +713,35 @@ mod tests {
|
|||
CalExtension { root: true },
|
||||
&CalendarQuery {
|
||||
selector: Some(CalendarSelector::Prop(dav::PropName(vec![
|
||||
dav::PropertyRequest::GetEtag,
|
||||
dav::PropertyRequest::Extension(PropertyRequest::CalendarData(CalendarDataRequest {
|
||||
mime: None,
|
||||
comp: Some(Comp {
|
||||
name: Component::VCalendar,
|
||||
prop_kind: PropKind::Prop(vec![
|
||||
CalProp {
|
||||
name: ComponentProperty("VERSION".into()),
|
||||
novalue: None,
|
||||
}
|
||||
]),
|
||||
comp_kind: CompKind::Comp(vec![
|
||||
Comp {
|
||||
name: Component::VEvent,
|
||||
comp_kind: CompKind::Comp(vec![]),
|
||||
prop_kind: PropKind::Prop(vec![
|
||||
CalProp { name: ComponentProperty("SUMMARY".into()), novalue: None },
|
||||
]),
|
||||
},
|
||||
Comp {
|
||||
name: Component::VTimeZone,
|
||||
prop_kind: PropKind::Prop(vec![]),
|
||||
comp_kind: CompKind::Comp(vec![]),
|
||||
}
|
||||
]),
|
||||
}),
|
||||
recurrence: None,
|
||||
limit_freebusy_set: None,
|
||||
})),
|
||||
]))),
|
||||
filter: Filter(CompFilter {
|
||||
name: Component::VCalendar,
|
||||
|
|
|
@ -1353,6 +1353,7 @@ pub enum Component {
|
|||
VEvent,
|
||||
VTodo,
|
||||
VAlarm,
|
||||
VTimeZone,
|
||||
Unknown(String),
|
||||
}
|
||||
impl Component {
|
||||
|
@ -1364,6 +1365,7 @@ impl Component {
|
|||
Self::VEvent => "VEVENT",
|
||||
Self::VTodo => "VTODO",
|
||||
Self::VAlarm => "VALARM",
|
||||
Self::VTimeZone => "VTIMEZONE",
|
||||
Self::Unknown(c) => c,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue