test_properties.py
This file
Path
tests/client/test_properties.py
17 lines · 479 bytes · Python
Last changed by
Automatically convert Client.cookies and Client.headers on set (#274)toppkbefore adoption9e420a5
History of this fileTake it
Automatically convert Client.cookies and Client.headers on set (#274)toppkbefore adoption9e420a5
lines 1–17why, one step back1from httpx import Client, Cookies, Headers234def test_client_headers():5 client = Client()6 client.headers = {"a": "b"}7 assert isinstance(client.headers, Headers)8 assert client.headers["A"] == "b"91011def test_client_cookies():12 client = Client()13 client.cookies = {"a": "b"}14 assert isinstance(client.cookies, Cookies)15 mycookies = list(client.cookies.jar)16 assert len(mycookies) == 117 assert mycookies[0].name == "a" and mycookies[0].value == "b"