test_connections.py
This file
Path
tests/dispatch/test_connections.py
39 lines · 1.4 KiB · Python
Last changed by
Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
History of this fileTake it
The walk stopped after 200 commits: lines older than e1ecb36 point at it.
Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b
line 1why, one step back1from httpx import HTTPConnectionCarefulness with encoding everywhereTom Christiebefore adoptione1ecb36
lines 2–3why, one step back23Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 4why, one step back4async def test_get(server, backend):Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
lines 5–6why, one step back5 async with HTTPConnection(origin=server.url, backend=backend) as conn:6 response = await conn.request("GET", server.url)Serve test server in thread (#292)Florimond Mancabefore adoption994403b
lines 7–9why, one step back7 await response.read()8 assert response.status_code == 2009 assert response.content == b"Hello, world!"Merge pull request #57 from yeraydiazdiaz/test-httpsTom Christiebefore adoptionc27c635
lines 10–11why, one step back1011Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 12why, one step back12async def test_post(server, backend):Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
lines 13–14why, one step back13 async with HTTPConnection(origin=server.url, backend=backend) as conn:14 response = await conn.request("GET", server.url, data=b"Hello, world!")Serve test server in thread (#292)Florimond Mancabefore adoption994403b
line 15why, one step back15 assert response.status_code == 200Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041
lines 16–17why, one step back1617Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 18why, one step back18async def test_https_get_with_ssl_defaults(https_server, backend):Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041
lines 19–21why, one step back19 """20 An HTTPS request, with default SSL configuration set on the client.21 """Serve test server in thread (#292)Florimond Mancabefore adoption994403b
line 22why, one step back22 async with HTTPConnection(Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 23why, one step back23 origin=https_server.url, verify=False, backend=backendServe test server in thread (#292)Florimond Mancabefore adoption994403b
line 24why, one step back24 ) as conn:Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 25why, one step back25 response = await conn.request("GET", https_server.url)Serve test server in thread (#292)Florimond Mancabefore adoption994403b
lines 26–28why, one step back26 await response.read()27 assert response.status_code == 20028 assert response.content == b"Hello, world!"Carefulness with encoding everywhereTom Christiebefore adoptione1ecb36
lines 29–30why, one step back2930Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 31why, one step back31async def test_https_get_with_sll_overrides(https_server, backend):Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041
lines 32–34why, one step back32 """33 An HTTPS request, with SSL configuration set on the request.34 """Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
lines 35–36why, one step back35 async with HTTPConnection(origin=https_server.url, backend=backend) as conn:36 response = await conn.request("GET", https_server.url, verify=False)Serve test server in thread (#292)Florimond Mancabefore adoption994403b
lines 37–39why, one step back37 await response.read()38 assert response.status_code == 20039 assert response.content == b"Hello, world!"