mirror of
https://github.com/bellingcat/whisperbox-transcribe.git
synced 2026-06-11 13:08:35 +03:00
19 lines
577 B
Python
19 lines
577 B
Python
def test_authorization_header_missing(client):
|
|
res = client.get("/api/v1/jobs")
|
|
assert res.status_code == 401
|
|
|
|
|
|
def test_authorization_header_malformed(client):
|
|
res = client.get("/api/v1/jobs", headers={"Authorization": "Bearer"})
|
|
assert res.status_code == 401
|
|
|
|
|
|
def test_incorrect_api_key(client):
|
|
res = client.get("/api/v1/jobs", headers={"Authorization": "Bearer incorrect"})
|
|
assert res.status_code == 401
|
|
|
|
|
|
def test_existing_api_key(client, auth_headers):
|
|
res = client.get("/api/v1/jobs", headers=auth_headers)
|
|
assert res.status_code == 200
|