|
|
|
@ -69,6 +69,22 @@ def test_root(): |
|
|
|
assert response.json() == {"message": "Hello World"} |
|
|
|
|
|
|
|
|
|
|
|
def test_read_with_oauth2_scheme(): |
|
|
|
response = client.get( |
|
|
|
"/with-oauth2-scheme", headers={"Authorization": "Bearer testtoken"} |
|
|
|
) |
|
|
|
assert response.status_code == 200, response.text |
|
|
|
assert response.json() == {"message": "Admin Access"} |
|
|
|
|
|
|
|
|
|
|
|
def test_read_with_get_token(): |
|
|
|
response = client.get( |
|
|
|
"/with-get-token", headers={"Authorization": "Bearer testtoken"} |
|
|
|
) |
|
|
|
assert response.status_code == 200, response.text |
|
|
|
assert response.json() == {"message": "Admin Access"} |
|
|
|
|
|
|
|
|
|
|
|
def test_read_token(): |
|
|
|
response = client.get("/items/", headers={"Authorization": "Bearer testtoken"}) |
|
|
|
assert response.status_code == 200, response.text |
|
|
|
|