diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 88b1cec..ecac00e 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -25,6 +25,7 @@ import posixpath import shutil import tempfile +import pytest from radicale import Application, config from . import BaseTest @@ -771,6 +772,15 @@ class BaseRequestsMixIn: status, headers, answer = self.request("GET", "/created_by_hook/") assert status == 404 + @pytest.mark.skipif(os.system("type flock") != 0, + reason="flock command not found") + def test_hook_storage_locked(self): + """Verify that the storage is locked when the hook runs.""" + self.configuration.set( + "storage", "hook", "flock -n .Radicale.lock || exit 0; exit 1") + status, headers, answer = self.request("MKCOL", "/calendar.ics/") + assert status == 201 + class BaseFileSystemTest(BaseTest): """Base class for filesystem backend tests."""