aboutsummaryrefslogtreecommitdiff
path: root/tests/views/test_endpoint.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-19 21:18:37 +0100
committerDennis Fink2026-11-19 21:18:37 +0100
commiteb11fb64e9cad6fbda2065362189653416d98577 (patch)
tree0bc5737b1c273ea6f04adc015154565c385dc719 /tests/views/test_endpoint.py
parent88f54d9a7699944b7d56f978e724b1c0b54dde98 (diff)
downloadwebmentions-ssg-eb11fb64e9cad6fbda2065362189653416d98577.tar.gz
webmentions-ssg-eb11fb64e9cad6fbda2065362189653416d98577.zip
test: expand failure and migration coverage
Add regression coverage for malformed input, lost task claims, moderation races, network failures, serializer validation, and production configuration guards. Exercise migration downgrade, backfill, and autogeneration paths plus additional receiver and sender edge cases.
Diffstat (limited to '')
-rw-r--r--tests/views/test_endpoint.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/views/test_endpoint.py b/tests/views/test_endpoint.py
index bf99ed4..63c17c6 100644
--- a/tests/views/test_endpoint.py
+++ b/tests/views/test_endpoint.py
@@ -529,3 +529,19 @@ def test_endpoint_records_initial_and_resubmission_events(
"Received submission",
"Resubmitted after cooldown",
]
+
+
+def test_submission_returns_none_when_competing_insert_cannot_be_found(
+ app: Flask, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ from webmentions_ssg.views import endpoint
+
+ find = Mock(return_value=None)
+ insert = Mock(return_value=None)
+ monkeypatch.setattr(endpoint, "find_received_webmention", find)
+ monkeypatch.setattr(endpoint, "try_insert_received_webmention", insert)
+
+ with app.app_context():
+ assert endpoint.record_submission(SOURCE_URL, TARGET_URL) is None
+ assert find.call_count == 2
+ insert.assert_called_once_with(SOURCE_URL, TARGET_URL)