-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local address support #134
Conversation
These tests are failing with an IPv6 address and asyncio. Not sure why yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
assert http_version == b"HTTP/1.1" | ||
assert status_code == 200 | ||
assert reason == b"OK" | ||
assert len(http._connections[url[:3]]) == 1 # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like this test tests that the local_address
actually gets used — I suppose that's intended for simplicity since testing that w/o mocking is not trivial?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving in advance since my other comments are mostly nits, really.
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
…into bwelling-master
@florimondmanca Fantastic review points as always - thank you! |
Based on #100 with a few extra minor changes.
local_address
as the keyword argument name. (If in doubt, follow the Trio API.)str
as the argument type. (Granted we're usingbytes
throughtout in ourrequest()
API, but I'm not sure I see the point in that here - all the underlying backends either expect or allow the address as a string. If in doubt, follow the Trio API.)local_address=...
on Trio. (currently only usable against trio master branch)open_tcp_stream()