Skip to content

Commit 83a31e5

Browse files
authored
Merge pull request #88 from tisnik/unit-tests-for-health-endpoints
Unit tests for health REST API endpoints
2 parents b993d76 + d55a618 commit 83a31e5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from app.endpoints.health import readiness_probe_get_method, liveness_probe_get_method
2+
3+
4+
def test_readiness_probe(mocker):
5+
"""Test the readiness endpoint handler."""
6+
response = readiness_probe_get_method()
7+
assert response is not None
8+
assert response.ready is True
9+
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)