From 2366d455c7d1ae16c84e0bcbffb94ed762c16832 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 13 Nov 2026 22:12:02 +0100 Subject: 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. --- tests/tasks/test_sender.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/tasks/test_sender.py') 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: -- cgit v1.3.1