aboutsummaryrefslogtreecommitdiff
path: root/tests/tasks/test_sender.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-15 20:42:20 +0100
committerDennis Fink2026-11-15 20:42:20 +0100
commit509d93b2976e353d29441a7a7b7e78ca466dc4fd (patch)
tree753e637aefabd4293f808addbf9c310eaf0aa552 /tests/tasks/test_sender.py
parentc74feda222745ab7cca8993df83d9ea5f9d07e5b (diff)
downloadwebmentions-ssg-509d93b2976e353d29441a7a7b7e78ca466dc4fd.tar.gz
webmentions-ssg-509d93b2976e353d29441a7a7b7e78ca466dc4fd.zip
refactor(core)!: standardize application terminology
Rename configuration keys, task helpers, forms, network utilities, and view endpoints to make their responsibilities and domains more explicit. Align source-management routes and templates with the new terminology and rename the target-matching module and related task abstractions consistently. BREAKING CHANGE: configuration keys have been renamed and sent-source routes move from `/sent` to `/sources`, with corresponding blueprint endpoint changes.
Diffstat (limited to 'tests/tasks/test_sender.py')
-rw-r--r--tests/tasks/test_sender.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/tasks/test_sender.py b/tests/tasks/test_sender.py
index 3a22769..032b638 100644
--- a/tests/tasks/test_sender.py
+++ b/tests/tasks/test_sender.py
@@ -110,7 +110,7 @@ def sender_module(app: Flask) -> ModuleType:
pytest.param(3, 1, 2, False, id="superseded"),
],
)
-def test_attempt_is_current(
+def test_revision_still_pending(
app: Flask,
sender_module: ModuleType,
desired_revision: int,
@@ -125,10 +125,10 @@ def test_attempt_is_current(
with app.app_context():
webmention = db.session.get(SentWebmention, identifier)
assert webmention is not None
- assert sender_module.attempt_is_current(webmention, revision) is expected
+ assert sender_module.revision_still_pending(webmention, revision) is expected
-def test_deliver_webmention_returns_retryable_outcome(
+def test_attempt_delivery_returns_retryable_outcome(
app: Flask, sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
) -> None:
mock_sender_requests(
@@ -136,7 +136,7 @@ def test_deliver_webmention_returns_retryable_outcome(
)
with app.app_context():
- result = sender_module.deliver_webmention(
+ result = sender_module.attempt_delivery(
SOURCE_URL, TARGET_URL, webmention_uuid=uuid.uuid7()
)
@@ -290,19 +290,13 @@ def test_send_webmention_persists_temporary_failure_with_backoff(
).total_seconds() == 3600
-def test_retry_delay_is_exponential_and_capped(
+def test_backoff_delay_is_exponential_and_capped(
app: Flask, sender_module: ModuleType
) -> None:
with app.app_context():
- assert [sender_module.retry_delay(n).total_seconds() for n in range(1, 8)] == [
- 3600,
- 7200,
- 14400,
- 28800,
- 57600,
- 86400,
- 86400,
- ]
+ assert [
+ sender_module.backoff_delay(n).total_seconds() for n in range(1, 8)
+ ] == [3600, 7200, 14400, 28800, 57600, 86400, 86400]
def test_temporary_failure_backoff_suppresses_duplicate_tasks_and_caps_attempts(
@@ -644,7 +638,7 @@ def test_send_webmention_ignores_superseded_attempt(
def post_temporary_failure(*args, **kwargs) -> None:
supersede_revision()
- raise sender_module.TemporarySenderError("Temporary failure")
+ raise sender_module.RetryableDeliveryError("Temporary failure")
post.side_effect = post_temporary_failure