test_queryparams.py
This file
Path
tests/client/test_queryparams.py
51 lines · 1.5 KiB · Python
Last changed by
Dispatcher -> AsyncDispatcher (#725)Tom Christiebefore adoptione19bd9b
History of this fileTake it
The walk stopped after 200 commits: lines older than b479ceb point at it.
Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 1–2why, one step back1import json2Drop sync (#544)Tom Christiebefore adoption206c537
lines 3–4why, one step back3import pytest4Rename Client to AsyncClient (with compat synonym) (#680)Florimond Mancabefore adoptione284b84
line 5why, one step back5from httpx import URL, AsyncClient, QueryParams, Request, ResponseTighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 6why, one step back6from httpx.config import CertTypes, TimeoutTypes, VerifyTypesDispatcher -> AsyncDispatcher (#725)Tom Christiebefore adoptione19bd9b
line 7why, one step back7from httpx.dispatch.base import AsyncDispatcherEnsure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 8–9why, one step back89Dispatcher -> AsyncDispatcher (#725)Tom Christiebefore adoptione19bd9b
line 10why, one step back10class MockDispatch(AsyncDispatcher):Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 11–12why, one step back11 async def send(12 self,Drop sync (#544)Tom Christiebefore adoption206c537
line 13why, one step back13 request: Request,Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 14–16why, one step back14 verify: VerifyTypes = None,15 cert: CertTypes = None,16 timeout: TimeoutTypes = None,Drop sync (#544)Tom Christiebefore adoption206c537
line 17why, one step back17 ) -> Response:Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 18–19why, one step back18 if request.url.path.startswith("/echo_queryparams"):19 body = json.dumps({"ok": "ok"}).encode()Drop sync (#544)Tom Christiebefore adoption206c537
line 20why, one step back20 return Response(200, content=body, request=request)Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 21–23why, one step back212223def test_client_queryparams():Rename Client to AsyncClient (with compat synonym) (#680)Florimond Mancabefore adoptione284b84
line 24why, one step back24 client = AsyncClient(params={"a": "b"})Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 25–29why, one step back25 assert isinstance(client.params, QueryParams)26 assert client.params["a"] == "b"272829def test_client_queryparams_string():Rename Client to AsyncClient (with compat synonym) (#680)Florimond Mancabefore adoptione284b84
line 30why, one step back30 client = AsyncClient(params="a=b")Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 31–33why, one step back31 assert isinstance(client.params, QueryParams)32 assert client.params["a"] == "b"33Rename Client to AsyncClient (with compat synonym) (#680)Florimond Mancabefore adoptione284b84
line 34why, one step back34 client = AsyncClient()Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 35–39why, one step back35 client.params = "a=b"36 assert isinstance(client.params, QueryParams)37 assert client.params["a"] == "b"3839Drop sync (#544)Tom Christiebefore adoption206c537
lines 40–41why, one step back40@pytest.mark.asyncio41async def test_client_queryparams_echo():Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 42–44why, one step back42 url = "http://example.org/echo_queryparams"43 client_queryparams = "first=str"44 request_queryparams = {"second": "dict"}Rename Client to AsyncClient (with compat synonym) (#680)Florimond Mancabefore adoptione284b84
line 45why, one step back45 client = AsyncClient(dispatch=MockDispatch(), params=client_queryparams)Drop sync (#544)Tom Christiebefore adoption206c537
line 46why, one step back46 response = await client.get(url, params=request_queryparams)Ensure py.typed makes it into source distributions. (#441)Andrew M. Whitebefore adoptionb479ceb
lines 47–51why, one step back4748 assert response.status_code == 20049 assert response.url == URL(50 "http://example.org/echo_queryparams?first=str&second=dict"51 )