diff options
| author | Dennis Fink | 2026-08-19 19:49:55 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-08-19 19:49:55 +0200 |
| commit | d0e245d63e014d268310976fc45429f08d2cbbe9 (patch) | |
| tree | ef2e96570723190baf02f05c2c4644a19ff1af78 /tests/test_url_security.py | |
| parent | d4a03623544aac0ce911d8471ff4b033bc3255e1 (diff) | |
| download | webmentions-ssg-d0e245d63e014d268310976fc45429f08d2cbbe9.tar.gz webmentions-ssg-d0e245d63e014d268310976fc45429f08d2cbbe9.zip | |
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.
Diffstat (limited to 'tests/test_url_security.py')
| -rw-r--r-- | tests/test_url_security.py | 10 |
1 files changed, 9 insertions, 1 deletions
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") |
