Anurag33Gaikwad commited on
Commit
e03e337
·
verified ·
1 Parent(s): a7cd65e

Update tests/test_health.py

Browse files
Files changed (1) hide show
  1. tests/test_health.py +15 -10
tests/test_health.py CHANGED
@@ -1,10 +1,15 @@
1
- from fastapi.testclient import TestClient
2
- from main import app
3
-
4
- client = TestClient(app)
5
-
6
- def test_root_health():
7
- resp = client.get("/")
8
- assert resp.status_code == 200
9
- body = resp.json()
10
- assert "status" in body
 
 
 
 
 
 
1
+ from fastapi.testclient import TestClient
2
+ from unittest.mock import patch
3
+ from main import app
4
+
5
+ client = TestClient(app)
6
+
7
+
8
+ def test_root_health():
9
+ with patch("app.services.prediction.is_model_available", return_value=True):
10
+ resp = client.get("/")
11
+
12
+ assert resp.status_code == 200
13
+ body = resp.json()
14
+ assert "status" in body
15
+ assert "modelLoaded" in body