소스 검색

Test that the requests fails if the hook fails

Unrud 9 년 전
부모
커밋
30b3273efa
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      radicale/tests/test_base.py

+ 9 - 0
radicale/tests/test_base.py

@@ -791,6 +791,15 @@ class BaseRequestsMixIn:
         status, headers, answer = self.request("GET", "/created_by_hook/")
         assert status == 200
 
+    def test_hook_fail(self):
+        """Verify that a request fails if the hook fails."""
+        self.configuration.set("storage", "hook", "exit 1")
+        try:
+            status, headers, answer = self.request("MKCOL", "/calendar.ics/")
+            assert status != 201
+        except Exception:
+            pass
+
 
 class BaseFileSystemTest(BaseTest):
     """Base class for filesystem backend tests."""