ソースを参照

Add test for deletion of collection

Unrud 9 年 前
コミット
9dd241a54b
1 ファイル変更11 行追加0 行削除
  1. 11 0
      radicale/tests/test_base.py

+ 11 - 0
radicale/tests/test_base.py

@@ -163,6 +163,17 @@ class BaseRequests:
         assert status == 200
         assert "DAV" in headers
 
+    def test_delete_collection(self):
+        """Delete a collection."""
+        self.request("MKCOL", "/calendar.ics/")
+        event = get_file_content("event1.ics")
+        self.request("PUT", "/calendar.ics/event1.ics", event)
+        status, headers, answer = self.request("DELETE", "/calendar.ics/")
+        assert status == 200
+        assert "href>/calendar.ics/</" in answer
+        status, headers, answer = self.request("GET", "/calendar.ics/")
+        assert status == 404
+
     def test_multiple_events_with_same_uid(self):
         """Add two events with the same UID."""
         self.request("MKCOL", "/calendar.ics/")