Test PROPPATCH

This commit is contained in:
Unrud 2016-08-11 00:20:48 +02:00
parent 51bf95f00d
commit 62892e3423
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<I:calendar-color xmlns:I="http://apple.com/ns/ical/" />
</D:prop>
</D:propfind>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:">
<D:set>
<D:prop>
<I:calendar-color xmlns:I="http://apple.com/ns/ical/">#BADA55</I:calendar-color>
</D:prop>
</D:set>
</D:propertyupdate>

View File

@ -213,6 +213,23 @@ class BaseRequestsMixIn:
assert "href>%s</" % calendar_path in answer
assert "href>%s</" % event_path in answer
def test_proppatch(self):
"""Write a property and read it back."""
self.request("MKCALENDAR", "/calendar.ics/")
proppatch = get_file_content("proppatch1.xml")
status, headers, answer = self.request(
"PROPPATCH", "/calendar.ics/", proppatch)
assert status == 207
assert "calendar-color" in answer
assert "200 OK</status" in answer
# Read property back
propfind = get_file_content("propfind1.xml")
status, headers, answer = self.request(
"PROPFIND", "/calendar.ics/", propfind)
assert status == 207
assert ":calendar-color>#BADA55</" in answer
assert "200 OK</status" in answer
def test_multiple_events_with_same_uid(self):
"""Add two events with the same UID."""
self.request("MKCOL", "/calendar.ics/")