From f62e6bc3e4b1a9e5841b8da575192b466d2789fb Mon Sep 17 00:00:00 2001 From: raghu Date: Wed, 11 Aug 2021 23:37:19 -0400 Subject: [PATCH 1/2] made changes --- main.py | 2 +- test_app.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e953071..48d45d7 100644 --- a/main.py +++ b/main.py @@ -58,4 +58,4 @@ def feedback_loop(data: List[FeedbackIn]): # Main function to start the app when main.py is called if __name__ == "__main__": # Uvicorn is used to run the server and listen for incoming API requests on 0.0.0.0:8888 - uvicorn.run("main:app", host="0.0.0.0", port=8887, reload=True) + uvicorn.run("main:app", host="0.0.0.0", port=8888, reload=True) diff --git a/test_app.py b/test_app.py index 37c7f7d..8b422ba 100644 --- a/test_app.py +++ b/test_app.py @@ -52,4 +52,5 @@ def test_pred_virginica2(): response = client.post("/predict_flower", json=payload) # asserting the correct response is received assert response.status_code == 200 - assert response.json() == {"flower_class": "Iris Setosa"} \ No newline at end of file + assert response.text(' ris Virginica') is in response.json() + #assert flower_class["Iris Virginica"] is in response.json() \ No newline at end of file From 613075b7ac88721a877ce60cf4ee8990f384d4c0 Mon Sep 17 00:00:00 2001 From: raghu Date: Thu, 12 Aug 2021 07:44:27 -0400 Subject: [PATCH 2/2] test case updated --- test_app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test_app.py b/test_app.py index 8b422ba..cee6b44 100644 --- a/test_app.py +++ b/test_app.py @@ -45,12 +45,11 @@ def test_pred_virginica2(): payload = { "sepal_length": 8, "sepal_width": 1, - "petal_length": 0.1, + "petal_length": 1, "petal_width": 8, } with TestClient(app) as client: response = client.post("/predict_flower", json=payload) # asserting the correct response is received assert response.status_code == 200 - assert response.text(' ris Virginica') is in response.json() - #assert flower_class["Iris Virginica"] is in response.json() \ No newline at end of file + assert response.json() == {"flower_class": "Iris Setosa"}