def test_prop(self): vcal_comp = ET.SubElement( self.requested, '{%s}comp' % caldav.NAMESPACE) vcal_comp.set('name', 'VCALENDAR') vtodo_comp = ET.SubElement(vcal_comp, '{%s}comp' % caldav.NAMESPACE) vtodo_comp.set('name', 'VTODO') completed_prop = ET.SubElement( vtodo_comp, '{%s}prop' % caldav.NAMESPACE) completed_prop.set('name', 'COMPLETED') self.extractEqual("""\ BEGIN:VCALENDAR BEGIN:VTODO COMPLETED:20100829T234417Z CREATED:20090606T042958Z END:VTODO END:VCALENDAR """, """\ BEGIN:VCALENDAR BEGIN:VTODO COMPLETED:20100829T234417Z END:VTODO END:VCALENDAR """) self.extractEqual("""\ BEGIN:VCALENDAR BEGIN:VEVENT CREATED:20090606T042958Z END:VEVENT END:VCALENDAR """, """\ BEGIN:VCALENDAR END:VCALENDAR """)
def test_allprop(self): vcal_comp = ET.SubElement(self.requested, "{%s}comp" % caldav.NAMESPACE) vcal_comp.set("name", "VCALENDAR") vtodo_comp = ET.SubElement(vcal_comp, "{%s}comp" % caldav.NAMESPACE) vtodo_comp.set("name", "VTODO") ET.SubElement(vtodo_comp, "{%s}allprop" % caldav.NAMESPACE) self.extractEqual( """\ BEGIN:VCALENDAR BEGIN:VTODO COMPLETED:20100829T234417Z CREATED:20090606T042958Z END:VTODO END:VCALENDAR """, """\ BEGIN:VCALENDAR BEGIN:VTODO COMPLETED:20100829T234417Z CREATED:20090606T042958Z END:VTODO END:VCALENDAR """, )
def test_allcomp(self): vcal_comp = ET.SubElement( self.requested, '{%s}comp' % caldav.NAMESPACE) vcal_comp.set('name', 'VCALENDAR') ET.SubElement(vcal_comp, '{%s}allcomp' % caldav.NAMESPACE) self.extractEqual("""\ BEGIN:VCALENDAR BEGIN:VTODO COMPLETED:20100829T234417Z CREATED:20090606T042958Z END:VTODO END:VCALENDAR """, """\ BEGIN:VCALENDAR BEGIN:VTODO END:VTODO END:VCALENDAR """)
def test_comp(self): comp = ET.SubElement(self.requested, "{%s}comp" % caldav.NAMESPACE) comp.set("name", "VCALENDAR") self.extractEqual( """\ BEGIN:VCALENDAR BEGIN:VTODO CLASS:PUBLIC COMPLETED:20100829T234417Z CREATED:20090606T042958Z END:VTODO END:VCALENDAR """, """\ BEGIN:VCALENDAR END:VCALENDAR """, )
async def get_value(unused_self, href, resource, ret, environ): ET.SubElement(ret, '{DAV:}collection')
def test_expand(self): expand = ET.SubElement(self.requested, '{%s}expand' % caldav.NAMESPACE) expand.set('start', '20060103T000000Z') expand.set('end', '20060105T000000Z') self.extractEqual("""\ BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060102T120000 DURATION:PT1H RRULE:FREQ=DAILY;COUNT=5 SUMMARY:Event #2 UID:[email protected] END:VEVENT BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060104T140000 DURATION:PT1H RECURRENCE-ID;TZID=US/Eastern:20060104T120000 SUMMARY:Event #2 bis UID:[email protected] END:VEVENT END:VCALENDAR """, """\ BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART:20060103T170000 DURATION:PT1H RECURRENCE-ID:20060103T170000 SUMMARY:Event #2 UID:[email protected] END:VEVENT BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART:20060104T190000 DURATION:PT1H RECURRENCE-ID:20060104T170000 SUMMARY:Event #2 bis UID:[email protected] END:VEVENT END:VCALENDAR """)
async def get_value(self, href, resource, ret, environ): ET.SubElement(ret, '{DAV:}href').text = '/user/'
async def get_value(self, href, resource, ret, environ): ET.SubElement(ret, "{DAV:}href").text = "/user/"