aboutsummaryrefslogtreecommitdiff
path: root/tests/tasks/test_sender.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-13 22:12:02 +0100
committerDennis Fink2026-11-13 22:12:02 +0100
commit2366d455c7d1ae16c84e0bcbffb94ed762c16832 (patch)
tree51de07737ebc12fdcbf29a0a405ff2cd5aa9eb87 /tests/tasks/test_sender.py
parent64f328d86bba9caa9d0a60aa89e06f70403942b9 (diff)
downloadwebmentions-ssg-2366d455c7d1ae16c84e0bcbffb94ed762c16832.tar.gz
webmentions-ssg-2366d455c7d1ae16c84e0bcbffb94ed762c16832.zip
refactor(core): split task workflows into focused helpers
Decompose receiver verification, source scanning, and Webmention delivery into explicit claim, check, reconciliation, and outcome-recording stages. Extract Huey backend parsing helpers and add focused tests for the new task boundaries while preserving existing processing semantics.
Diffstat (limited to '')
-rw-r--r--tests/tasks/test_sender.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/tasks/test_sender.py b/tests/tasks/test_sender.py
index 818092b..7f453c1 100644
--- a/tests/tasks/test_sender.py
+++ b/tests/tasks/test_sender.py
@@ -127,6 +127,26 @@ def test_attempt_is_current(
assert sender_module.attempt_is_current(webmention, revision) is expected
+def test_deliver_webmention_returns_retryable_outcome(
+ app: Flask, sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ mock_sender_requests(sender_module, monkeypatch, result=(503, None))
+
+ with app.app_context():
+ result = sender_module.deliver_webmention(
+ SOURCE_URL, TARGET_URL, webmention_uuid=uuid.uuid7()
+ )
+
+ assert result == sender_module.DeliveryResult(
+ status=SentWebmentionStatus.FAILED,
+ reason="Webmention endpoint returned HTTP 503",
+ endpoint=ENDPOINT_URL,
+ response_status=503,
+ terminal=False,
+ temporary_failure=True,
+ )
+
+
def test_send_webmention_persists_success(
app: Flask, sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
) -> None: