Skip to content
Myr

test_properties.py

This file

Path

tests/client/test_properties.py

68 lines · 1.9 KiB · Python

Last changed by

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

History of this file

Take it

The walk stopped after 200 commits: lines older than 9d022c0 point at it.

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 1–5why, one step back
1import httpx
234def test_client_base_url():5 client = httpx.Client()

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

line 6why, one step back
6 client.base_url = "https://www.example.org/"

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 7–12why, one step back
7 assert isinstance(client.base_url, httpx.URL)
8 assert client.base_url == "https://www.example.org/"91011def test_client_base_url_without_trailing_slash():12 client = httpx.Client()

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

line 13why, one step back
13 client.base_url = "https://www.example.org/path"

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 14–19why, one step back
14 assert isinstance(client.base_url, httpx.URL)
15 assert client.base_url == "https://www.example.org/path/"161718def test_client_base_url_with_trailing_slash():19 client = httpx.Client()

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

line 20why, one step back
20 client.base_url = "https://www.example.org/path/"

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 21–26why, one step back
21 assert isinstance(client.base_url, httpx.URL)
22 assert client.base_url == "https://www.example.org/path/"232425def test_client_headers():26 client = httpx.Client()

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

line 27why, one step back
27 client.headers = {"a": "b"}

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 28–33why, one step back
28 assert isinstance(client.headers, httpx.Headers)
29 assert client.headers["A"] == "b"303132def test_client_cookies():33 client = httpx.Client()

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

line 34why, one step back
34 client.cookies = {"a": "b"}

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 35–44why, one step back
35 assert isinstance(client.cookies, httpx.Cookies)
36 mycookies = list(client.cookies.jar)37 assert len(mycookies) == 138 assert mycookies[0].name == "a" and mycookies[0].value == "b"394041def test_client_timeout():42 expected_timeout = 12.043 client = httpx.Client()44

Upgrade Python type checker mypy (#3654)Christian Claussbefore adoptionb55d463

line 45why, one step back
45 client.timeout = expected_timeout

Bump ruff from 0.0.260 to 0.0.275 (#2753)dependabot[bot]before adoption9d022c0

lines 46–68why, one step back
46
47 assert isinstance(client.timeout, httpx.Timeout)48 assert client.timeout.connect == expected_timeout49 assert client.timeout.read == expected_timeout50 assert client.timeout.write == expected_timeout51 assert client.timeout.pool == expected_timeout525354def test_client_event_hooks():55 def on_request(request):56 pass # pragma: no cover5758 client = httpx.Client()59 client.event_hooks = {"request": [on_request]}60 assert client.event_hooks == {"request": [on_request], "response": []}616263def test_client_trust_env():64 client = httpx.Client()65 assert client.trust_env6667 client = httpx.Client(trust_env=False)68 assert not client.trust_env