From eb11fb64e9cad6fbda2065362189653416d98577 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 19 Nov 2026 21:18:37 +0100 Subject: test: expand failure and migration coverage Add regression coverage for malformed input, lost task claims, moderation races, network failures, serializer validation, and production configuration guards. Exercise migration downgrade, backfill, and autogeneration paths plus additional receiver and sender edge cases. --- tests/test_moderation_policy.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/test_moderation_policy.py') diff --git a/tests/test_moderation_policy.py b/tests/test_moderation_policy.py index 48a34ac..3421ba5 100644 --- a/tests/test_moderation_policy.py +++ b/tests/test_moderation_policy.py @@ -60,3 +60,8 @@ def test_allowlist_is_fail_closed_and_blocklist_takes_precedence(app: Flask) -> == "Source domain is blocked" ) assert rejection_reason("https://example.org/post") is None + + +def test_rejection_reason_reports_invalid_source_hostname(app: Flask) -> None: + with app.app_context(): + assert rejection_reason("http://[not-an-ip") == "Invalid source hostname" -- cgit v1.3.1