From b0ef194a4b84a3ed33b973d6589874388c2539cd Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 17 Sep 2017 14:04:02 +0200 Subject: [PATCH] Test PROPFIND requests with propname and allprop --- radicale/tests/static/allprop.xml | 4 ++++ radicale/tests/static/propname.xml | 4 ++++ radicale/tests/test_base.py | 34 +++++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 radicale/tests/static/allprop.xml create mode 100644 radicale/tests/static/propname.xml diff --git a/radicale/tests/static/allprop.xml b/radicale/tests/static/allprop.xml new file mode 100644 index 0000000..1b7692d --- /dev/null +++ b/radicale/tests/static/allprop.xml @@ -0,0 +1,4 @@ + + + + diff --git a/radicale/tests/static/propname.xml b/radicale/tests/static/propname.xml new file mode 100644 index 0000000..2f56bc0 --- /dev/null +++ b/radicale/tests/static/propname.xml @@ -0,0 +1,4 @@ + + + + diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 9f30954..ab0c26d 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -370,6 +370,34 @@ class BaseRequestsMixIn: assert "href>%s%s" in answer + status, _, answer = self.request( + "PROPFIND", "/calendar.ics/event.ics", propfind) + assert "" in answer + + def test_propfind_allprop(self): + status, _, _ = self.request("MKCALENDAR", "/calendar.ics/") + assert status == 201 + event = get_file_content("event1.ics") + status, _, _ = self.request("PUT", "/calendar.ics/event.ics", event) + assert status == 201 + propfind = get_file_content("allprop.xml") + status, _, answer = self.request( + "PROPFIND", "/calendar.ics/", propfind) + assert "" in answer + status, _, answer = self.request( + "PROPFIND", "/calendar.ics/event.ics", propfind) + assert "" in answer + def test_proppatch(self): """Write a property and read it back.""" status, _, _ = self.request("MKCALENDAR", "/calendar.ics/") @@ -385,8 +413,12 @@ class BaseRequestsMixIn: status, _, answer = self.request( "PROPFIND", "/calendar.ics/", propfind) assert status == 207 - assert ":calendar-color>#BADA55#BADA55" in answer def test_put_whole_calendar_multiple_events_with_same_uid(self): """Add two events with the same UID."""