httpx/tests/client/test_properties.py
Florimond Manca e284b84bf9 Rename Client to AsyncClient (with compat synonym) (#680)
* Rename Client to AsyncClient (with compat synonym)

* Document motivation for AsyncClient renaming

Co-authored-by: Tom Christie <tom@tomchristie.com>
2019-12-29 15:34:23 +00:00

18 lines
494 B
Python

from httpx import AsyncClient, Cookies, Headers
def test_client_headers():
client = AsyncClient()
client.headers = {"a": "b"}
assert isinstance(client.headers, Headers)
assert client.headers["A"] == "b"
def test_client_cookies():
client = AsyncClient()
client.cookies = {"a": "b"}
assert isinstance(client.cookies, Cookies)
mycookies = list(client.cookies.jar)
assert len(mycookies) == 1
assert mycookies[0].name == "a" and mycookies[0].value == "b"