Skip to content

Commit

Permalink
Add invalid API key test
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoelTT committed Dec 31, 2024
1 parent 297cdec commit f12988d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tt-metal-yolov4/tests/test_inference_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ def test_valid_api_call():
assert isinstance(response.json(), list)


def test_invalid_api_call():
# get sample image file
file = sample_file()
# make request with INVALID auth header
headers = get_auth_header()
headers.update(Authorization="INVALID API KEY")
response = requests.post(API_URL, files=file, headers=headers)
# assert request was unauthorized
assert response.status_code == HTTPStatus.UNAUTHORIZED


@pytest.mark.skip(
reason="Not implemented, see https://github.com/tenstorrent/tt-inference-server/issues/63"
)
Expand Down

0 comments on commit f12988d

Please sign in to comment.