From eb15de0c5b7af580546bbd8a2be31c636f5af019 Mon Sep 17 00:00:00 2001 From: Unrud Date: Mon, 8 Aug 2016 06:09:24 +0200 Subject: [PATCH] Test PUT with whole collection --- radicale/tests/test_base.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 8d06dbc..ad061ef 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -119,6 +119,21 @@ class BaseRequests: assert "DTSTART;TZID=Europe/Paris:20140901T180000" in answer assert "DTEND;TZID=Europe/Paris:20140901T210000" in answer + def test_put_whole_collection(self): + """Create and overwrite a whole collection.""" + event = get_file_content("event1.ics") + status, headers, answer = self.request("PUT", "/calendar.ics/", event) + assert status == 201 + status, headers, answer = self.request( + "PUT", "/calendar.ics/event1.ics", event) + assert status == 201 + # Overwrite + status, headers, answer = self.request("PUT", "/calendar.ics/", event) + assert status == 201 + status, headers, answer = self.request( + "GET", "/calendar.ics/event1.ics") + assert status == 404 + def test_delete(self): """Delete an event.""" self.request("MKCOL", "/calendar.ics/")