Skip to content

Commit

Permalink
test status code
Browse files Browse the repository at this point in the history
  • Loading branch information
ipranjal committed Nov 19, 2023
1 parent 68a4c7e commit dc4b373
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@ def test_predict_9():
X,y = get_processed_data()
response = app.test_client().post("/predict", json={"image":X[9].tolist()})
assert response.status_code == 200
assert response.get_json()['prediction'] == [9]
assert response.get_json()['prediction'] == [9]

def test_status_code():
response = app.test_client().get("/")
assert response.status_code == 200
response = app.test_client().get("/random")
assert response.status_code == 404

0 comments on commit dc4b373

Please sign in to comment.