Skip to content

Commit

Permalink
check resolution of example.net more loosely (#19155) (#19173)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle Altendorf <[email protected]>
  • Loading branch information
AmineKhaldi and altendky authored Jan 28, 2025
1 parent 26217db commit 9343b14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions chia/_tests/util/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ async def test_resolve4() -> None:
assert await resolve("127.0.0.1", prefer_ipv6=prefer_ipv6) == IPAddress.create("127.0.0.1")
assert await resolve("10.11.12.13", prefer_ipv6=prefer_ipv6) == IPAddress.create("10.11.12.13")
assert await resolve("localhost", prefer_ipv6=prefer_ipv6) == IPAddress.create("127.0.0.1")
assert await resolve("example.net", prefer_ipv6=prefer_ipv6) == IPAddress.create("93.184.215.14")
example = await resolve("example.net", prefer_ipv6=prefer_ipv6)
assert example.is_v4
assert not example.is_private


@pytest.mark.anyio
Expand All @@ -35,9 +37,9 @@ async def test_resolve6() -> None:
# on some systems. Just test neither here.
# assert await resolve("ip6-localhost", prefer_ipv6=prefer_ipv6) == IPAddress.create("::1")
# assert await resolve("localhost", prefer_ipv6=prefer_ipv6) == IPAddress.create("::1")
assert await resolve("example.net", prefer_ipv6=prefer_ipv6) == IPAddress.create(
"2606:2800:21f:cb07:6820:80da:af6b:8b2c"
)
example = await resolve("example.net", prefer_ipv6=prefer_ipv6)
assert example.is_v6
assert not example.is_private


@pytest.mark.parametrize(
Expand Down

0 comments on commit 9343b14

Please sign in to comment.