Explorar o código

Test that the root collection always exists

Test for 6c3e59fd11400734a8b9ec9942858724a36e3f1d
Unrud %!s(int64=9) %!d(string=hai) anos
pai
achega
6d80b70b8c
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      radicale/tests/test_base.py

+ 10 - 0
radicale/tests/test_base.py

@@ -734,6 +734,16 @@ class BaseRequestsMixIn:
             "GET", "/user/", REMOTE_USER="user")
         assert status == 200
 
+    def test_existence_of_root_collections(self):
+        """Verify that the root collection always exists."""
+        # Use PROPFIND because GET returns message
+        status, headers, answer = self.request("PROPFIND", "/")
+        assert status == 207
+        # it should still exist after deletion
+        self.request("DELETE", "/")
+        status, headers, answer = self.request("PROPFIND", "/")
+        assert status == 207
+
 
 class BaseFileSystemTest(BaseTest):
     """Base class for filesystem backend tests."""