Files
Tom Christie ce1c9103ca Add auth test
2019-03-21 13:17:11 +00:00

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='