diff options
| author | Dennis Fink | 2026-11-19 21:18:37 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-19 21:18:37 +0100 |
| commit | eb11fb64e9cad6fbda2065362189653416d98577 (patch) | |
| tree | 0bc5737b1c273ea6f04adc015154565c385dc719 /tests/test_moderation_policy.py | |
| parent | 88f54d9a7699944b7d56f978e724b1c0b54dde98 (diff) | |
| download | webmentions-ssg-eb11fb64e9cad6fbda2065362189653416d98577.tar.gz webmentions-ssg-eb11fb64e9cad6fbda2065362189653416d98577.zip | |
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.
Diffstat (limited to 'tests/test_moderation_policy.py')
| -rw-r--r-- | tests/test_moderation_policy.py | 5 |
1 files changed, 5 insertions, 0 deletions
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" |
