Skip to content

Fix health tests #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meilisearch/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_all_stats(self):
def health(self):
"""Get health of the MeiliSearch server.

`204` HTTP status response when MeiliSearch is healthy.
`200` HTTP status response when MeiliSearch is healthy.

Raises
------
Expand Down
6 changes: 3 additions & 3 deletions meilisearch/tests/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ def test_get_client():
client = meilisearch.Client(BASE_URL, MASTER_KEY)
assert client.config
response = client.health()
assert response.status_code >= 200 and response.status_code < 400
assert response['status'] == 'available'


def test_client_timeout_set():
timeout = 5
client = meilisearch.Client(BASE_URL, MASTER_KEY, timeout=timeout)
response = client.health()
assert client.config.timeout == timeout
assert response.status_code >= 200 and response.status_code < 400
assert response['status'] == 'available'


def test_client_timeout_not_set():
default_timeout = None
client = meilisearch.Client(BASE_URL, MASTER_KEY)
response = client.health()
assert client.config.timeout == default_timeout
assert response.status_code >= 200 and response.status_code < 400
assert response['status'] == 'available'
2 changes: 1 addition & 1 deletion meilisearch/tests/client/test_client_health_meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
def test_health(client):
"""Tests checking the health of the MeiliSearch instance."""
response = client.health()
assert response.status_code >= 200 and response.status_code < 400
assert response['status'] == 'available'