mirror of
https://github.com/not-kennethreitz/requests-async.git
synced 2026-06-05 23:10:17 +00:00
11 lines
320 B
Python
11 lines
320 B
Python
import requests_async
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_auth(server):
|
|
url = "http://127.0.0.1:8000/echo_headers"
|
|
response = await requests_async.get(url, auth=('tom', 'pass'))
|
|
assert response.status_code == 200
|
|
assert response.json()['headers']['authorization'] == 'Basic dG9tOnBhc3M='
|