Skip to content

Commit d55a618

Browse files
committed
Unit test for /liveness REST API endpoint
1 parent dc37d9e commit d55a618

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from app.endpoints.health import readiness_probe_get_method
1+
from app.endpoints.health import readiness_probe_get_method, liveness_probe_get_method
22

33

44
def test_readiness_probe(mocker):
@@ -7,3 +7,10 @@ def test_readiness_probe(mocker):
77
assert response is not None
88
assert response.ready is True
99
assert response.reason == "service is ready"
10+
11+
12+
def test_liveness_probe(mocker):
13+
"""Test the liveness endpoint handler."""
14+
response = liveness_probe_get_method()
15+
assert response is not None
16+
assert response.alive is True

0 commit comments

Comments
 (0)