-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
246: Standardize health method r=bidoubiwa a=alallema Checking that method health() return `{'status': 'available'}` and added isHealthy() method who return boolean value meilisearch/integration-guides#55 Co-authored-by: alallema <amelie@meilisearch.com>
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
meilisearch/tests/client/test_client_health_meilisearch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
import meilisearch | ||
|
||
def test_health(client): | ||
"""Tests checking the health of the MeiliSearch instance.""" | ||
response = client.health() | ||
assert response['status'] == 'available' | ||
|
||
def test_is_healthy(client): | ||
"""Tests checking if is_healthy return true when MeiliSearch instance is available.""" | ||
response = client.is_healthy() | ||
assert response is True | ||
|
||
def test_is_healthy_bad_route(): | ||
"""Tests checking if is_healthy returns false when trying to reach a bad URL.""" | ||
client = meilisearch.Client("http://wrongurl:1234") | ||
response = client.is_healthy() | ||
assert response is False |