Skip to content

Commit

Permalink
feat: add coverage for passing local addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Dec 9, 2023
1 parent a7ac92a commit 2ea9717
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,9 @@ async def _sock_connect(
== mock_socket
)

# IPv6 addresses are tried first, but the first one fails so second IPv6 wins
# because interleave is 2
assert mock_socket.family == socket.AF_INET6
assert create_calls == [("dead:beef::", 80, 0, 0), ("dead:aaaa::", 80, 0, 0)]
# IPv6 is tried first and fails, which means IPv4 is tried next and succeeds
assert mock_socket.family == socket.AF_INET
assert create_calls == [("dead:beef::", 80, 0, 0), ("107.6.106.83", 80)]


@pytest.mark.asyncio
Expand Down

0 comments on commit 2ea9717

Please sign in to comment.