test_connections.py
This file
Path
tests/dispatch/test_connections.py
44 lines · 1.5 KiB · Python
Last changed by
SSLConfig refactor (#706)Tom Christiebefore adoptionb0bf2a7
History of this fileTake it
The walk stopped after 200 commits: lines older than 8155352 point at it.
Handle h11.Connection.next_event() RemoteProtocolError (#524)toppkbefore adoptionf06ca87
line 1why, one step back1import pytestDocument digest auth (#348)Yeray Diaz Diazbefore adoption8155352
line 2why, one step back2Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 3why, one step back3import httpxSSLConfig refactor (#706)Tom Christiebefore adoptionb0bf2a7
line 4why, one step back4from httpx.config import SSLConfigTighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 5why, one step back5from httpx.dispatch.connection import HTTPConnectionDocument digest auth (#348)Yeray Diaz Diazbefore adoption8155352
line 6why, one step back6Handle h11.Connection.next_event() RemoteProtocolError (#524)toppkbefore adoptionf06ca87
line 7why, one step back7Clean up 'backend' fixture (#664)Florimond Mancabefore adoptiond0427be
lines 8–9why, one step back8@pytest.mark.usefixtures("async_environment")9async def test_get(server):Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 10why, one step back10 async with HTTPConnection(origin=server.url) as conn:Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
line 11why, one step back11 response = await conn.request("GET", server.url)Rename 'read/close' to 'aread/aclose' on Response (#674)Florimond Mancabefore adoptionf9d18a8
line 12why, one step back12 await response.aread()Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
lines 13–16why, one step back13 assert response.status_code == 20014 assert response.content == b"Hello, world!"1516Clean up 'backend' fixture (#664)Florimond Mancabefore adoptiond0427be
lines 17–18why, one step back17@pytest.mark.usefixtures("async_environment")18async def test_post(server):Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 19why, one step back19 async with HTTPConnection(origin=server.url) as conn:Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
lines 20–21why, one step back20 response = await conn.request("GET", server.url, data=b"Hello, world!")21 assert response.status_code == 200Handle h11.Connection.next_event() RemoteProtocolError (#524)toppkbefore adoptionf06ca87
lines 22–23why, one step back2223Clean up 'backend' fixture (#664)Florimond Mancabefore adoptiond0427be
lines 24–25why, one step back24@pytest.mark.usefixtures("async_environment")25async def test_premature_close(server):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 26why, one step back26 with pytest.raises(httpx.ConnectionClosed):Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 27why, one step back27 async with HTTPConnection(origin=server.url) as conn:Handle h11.Connection.next_event() RemoteProtocolError (#524)toppkbefore adoptionf06ca87
lines 28–30why, one step back28 response = await conn.request(29 "GET", server.url.copy_with(path="/premature_close")30 )Rename 'read/close' to 'aread/aclose' on Response (#674)Florimond Mancabefore adoptionf9d18a8
line 31why, one step back31 await response.aread()Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
lines 32–33why, one step back3233Clean up 'backend' fixture (#664)Florimond Mancabefore adoptiond0427be
line 34why, one step back34@pytest.mark.usefixtures("async_environment")Drop per-request `cert`, `verify`, and `trust_env` (#617)Florimond Mancabefore adoptione9ebd1d
line 35why, one step back35async def test_https_get_with_ssl(https_server, ca_cert_pem_file):Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
line 36why, one step back36 """Drop per-request `cert`, `verify`, and `trust_env` (#617)Florimond Mancabefore adoptione9ebd1d
line 37why, one step back37 An HTTPS request, with SSL configuration set on the client.Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
line 38why, one step back38 """SSLConfig refactor (#706)Tom Christiebefore adoptionb0bf2a7
lines 39–40why, one step back39 ssl = SSLConfig(verify=ca_cert_pem_file)40 async with HTTPConnection(origin=https_server.url, ssl=ssl) as conn:Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
line 41why, one step back41 response = await conn.request("GET", https_server.url)Rename 'read/close' to 'aread/aclose' on Response (#674)Florimond Mancabefore adoptionf9d18a8
line 42why, one step back42 await response.aread()Document digest auth (#348)Yeray Diaz Diazbefore adoption8155352
lines 43–44why, one step back43 assert response.status_code == 20044 assert response.content == b"Hello, world!"