Skip to content

Commit 52c6e39

Browse files
authored
Fix health tests (#241)
1 parent 14ff43e commit 52c6e39

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

meilisearch/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def get_all_stats(self):
152152
def health(self):
153153
"""Get health of the MeiliSearch server.
154154
155-
`204` HTTP status response when MeiliSearch is healthy.
155+
`200` HTTP status response when MeiliSearch is healthy.
156156
157157
Raises
158158
------

meilisearch/tests/client/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ def test_get_client():
99
client = meilisearch.Client(BASE_URL, MASTER_KEY)
1010
assert client.config
1111
response = client.health()
12-
assert response.status_code >= 200 and response.status_code < 400
12+
assert response['status'] == 'available'
1313

1414

1515
def test_client_timeout_set():
1616
timeout = 5
1717
client = meilisearch.Client(BASE_URL, MASTER_KEY, timeout=timeout)
1818
response = client.health()
1919
assert client.config.timeout == timeout
20-
assert response.status_code >= 200 and response.status_code < 400
20+
assert response['status'] == 'available'
2121

2222

2323
def test_client_timeout_not_set():
2424
default_timeout = None
2525
client = meilisearch.Client(BASE_URL, MASTER_KEY)
2626
response = client.health()
2727
assert client.config.timeout == default_timeout
28-
assert response.status_code >= 200 and response.status_code < 400
28+
assert response['status'] == 'available'

meilisearch/tests/client/test_client_health_meilisearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
def test_health(client):
33
"""Tests checking the health of the MeiliSearch instance."""
44
response = client.health()
5-
assert response.status_code >= 200 and response.status_code < 400
5+
assert response['status'] == 'available'

0 commit comments

Comments
 (0)