diff options
Diffstat (limited to 'tests/tasks/test_sender.py')
| -rw-r--r-- | tests/tasks/test_sender.py | 20 |
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: |
