aboutsummaryrefslogtreecommitdiff
path: root/tests/tasks/test_sender.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/tasks/test_sender.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/tasks/test_sender.py b/tests/tasks/test_sender.py
index 0db0d8c..38bae11 100644
--- a/tests/tasks/test_sender.py
+++ b/tests/tasks/test_sender.py
@@ -1214,43 +1214,6 @@ def test_send_webmention_ignores_unknown_identifier(
assert f"Cannot send unknown SentWebmention {identifier}" in caplog.text
-def test_ensure_public_request_accepts_public_url(
- sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
-) -> None:
- is_public_url = Mock(return_value=True)
- monkeypatch.setattr(sender_module, "is_public_url", is_public_url)
- sender_module.ensure_public_request(httpx.Request("GET", TARGET_URL))
- is_public_url.assert_called_once_with(TARGET_URL)
-
-
-def test_ensure_public_request_rejects_non_public_address(
- sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
-) -> None:
- is_public_url = Mock(return_value=False)
- monkeypatch.setattr(sender_module, "is_public_url", is_public_url)
- with pytest.raises(
- sender_module.PermanentSenderError,
- match="Request resolves to a non-public address",
- ):
- sender_module.ensure_public_request(httpx.Request("GET", TARGET_URL))
- is_public_url.assert_called_once_with(TARGET_URL)
-
-
-def test_ensure_public_request_maps_dns_failure_to_temporary_error(
- sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
-) -> None:
- is_public_url = Mock(
- side_effect=AddressResolutionError("Could not resolve hostname")
- )
- monkeypatch.setattr(sender_module, "is_public_url", is_public_url)
- with pytest.raises(
- sender_module.TemporarySenderError,
- match="Request hostname could not be resolved",
- ):
- sender_module.ensure_public_request(httpx.Request("GET", TARGET_URL))
- is_public_url.assert_called_once_with(TARGET_URL)
-
-
def test_resolve_endpoint_rejects_invalid_url(
sender_module: ModuleType, monkeypatch: pytest.MonkeyPatch
) -> None: