Ejemplo n.º 1
0
def authorized_client(client: Client, token: str,
                      authorization_prefix: str) -> Client:
    client.headers = {
        "Authorization": f"{authorization_prefix} {token}",
        **client.headers,
    }
    return client
Ejemplo n.º 2
0
def test_client_headers():
    client = Client()
    client.headers = {"a": "b"}
    assert isinstance(client.headers, Headers)
    assert client.headers["A"] == "b"