aboutsummaryrefslogtreecommitdiff
path: root/tests/test_url_security.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_url_security.py')
-rw-r--r--tests/test_url_security.py10
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")