aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_net.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_net.py b/tests/test_net.py
index 928a0d5..05ae5a4 100644
--- a/tests/test_net.py
+++ b/tests/test_net.py
@@ -191,6 +191,16 @@ def test_ip_literal_does_not_use_dns() -> None:
dns_resolve.assert_not_called()
+def test_public_addresses_resolves_hostname_once() -> None:
+ with patch("webmentions_ssg.net.dns.resolver.resolve_name") as resolve:
+ resolve.return_value.addresses.return_value = ["93.184.216.34", "8.8.8.8"]
+ assert public_addresses("example.com", lifetime=1.5) == (
+ "93.184.216.34",
+ "8.8.8.8",
+ )
+ resolve.assert_called_once_with("example.com", lifetime=1.5)
+
+
@pytest.mark.parametrize(
"address",
[