From d0e245d63e014d268310976fc45429f08d2cbbe9 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 19 Aug 2026 19:49:55 +0200 Subject: refactor(core): improve typing and test coverage Restructure database and user CLI commands, make passwords write-only model properties, and use the UTC datetime constant throughout the application. Add PEP 287-style documentation and expand receiver, scanner, sender, and URL security tests to cover error paths and edge cases. --- tests/test_url_security.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/test_url_security.py') diff --git a/tests/test_url_security.py b/tests/test_url_security.py index ffa0378..70d5146 100644 --- a/tests/test_url_security.py +++ b/tests/test_url_security.py @@ -3,7 +3,11 @@ from unittest.mock import Mock, patch import dns.resolver import pytest -from webmentions_ssg.url_security import AddressResolutionError, is_public_url +from webmentions_ssg.url_security import ( + AddressResolutionError, + is_http_url, + is_public_url, +) @patch("webmentions_ssg.url_security.dns.resolver.resolve_name") @@ -66,3 +70,7 @@ def test_is_public_url_raises_when_url_has_no_hostname(resolve_name: Mock) -> No is_public_url("/relative/url") resolve_name.assert_not_called() + + +def test_is_http_url_rejects_malformed_url() -> None: + assert not is_http_url("http://[::1") -- cgit v1.3.1