From bd0d5038b3138c3277c59835fdd822af97920c83 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 20 Oct 2025 07:41:12 +0200 Subject: [PATCH 1/2] cosmetics --- radicale/tests/test_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index cf9b87d8..b94ae15e 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -230,7 +230,7 @@ permissions: RrWw""") assert "DTSTAMP:20130902T150159Z" in answer def test_update_event_no_etag_strict_preconditions_true(self) -> None: - """Update an event without serving etag.""" + """Update an event without serving etag having strict_preconditions enabled (Precondition Failed).""" self.configure({"storage": {"strict_preconditions": True}}) self.mkcalendar("/calendar.ics/") event = get_file_content("event1.ics") @@ -240,7 +240,7 @@ permissions: RrWw""") self.put(path, event_modified, check=412) def test_update_event_with_etag_strict_preconditions_true(self) -> None: - """Update an event with serving etag.""" + """Update an event with serving equal etag having strict_preconditions enabled (OK).""" self.configure({"storage": {"strict_preconditions": True}}) self.configure({"logging": {"response_content_on_debug": True}}) self.mkcalendar("/calendar.ics/") From 54bd8023b3ba87797712337b56dbd6c53a090ce8 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 20 Oct 2025 07:41:27 +0200 Subject: [PATCH 2/2] add additional etag related tests --- radicale/tests/test_base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index b94ae15e..c13c8725 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -263,6 +263,22 @@ permissions: RrWw""") assert status == 200 and prop.text self.put(path, event_modified, check=204, http_if_match=prop.text) + def test_update_event_with_etag_mismatch(self) -> None: + """Update an event with serving mismatch etag (Precondition Failed).""" + self.mkcalendar("/calendar.ics/") + event = get_file_content("event1.ics") + event_modified = get_file_content("event1_modified.ics") + path = "/calendar.ics/event1.ics" + self.put(path, event, check=201) + self.put(path, event_modified, check=412, http_if_match="0000") + + def test_add_event_with_etag(self) -> None: + """Add an event with serving etag (Precondition Failed).""" + self.mkcalendar("/calendar.ics/") + event = get_file_content("event1.ics") + path = "/calendar.ics/event1.ics" + self.put(path, event, check=412, http_if_match="0000") + def test_update_event_uid_event(self) -> None: """Update an event with a different UID.""" self.mkcalendar("/calendar.ics/")