Skip to content

Commit c25fc71

Browse files
committed
fix: fixed test cases
1 parent 48b1dd0 commit c25fc71

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

tests/client/test_client_multi_search_meilisearch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from meilisearch.errors import MeilisearchApiError
44
from tests.common import INDEX_UID, REMOTE_MS_1, REMOTE_MS_2
5+
from tests.test_utils import disable_sharding
56

67

78
def test_basic_multi_search(client, empty_index):
@@ -111,3 +112,4 @@ def test_multi_search_with_network(client, index_with_documents):
111112
assert response["hits"][0]["_federation"]["indexUid"] == INDEX_UID
112113
assert response["hits"][0]["_federation"]["remote"] == REMOTE_MS_1
113114
assert response["remoteErrors"] == {}
115+
disable_sharding(client)

tests/client/test_client_network.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

33
from tests.common import REMOTE_MS_1, REMOTE_MS_2
4+
from tests.test_utils import disable_sharding
45

56

67
@pytest.mark.usefixtures("enable_network_options")
@@ -38,3 +39,5 @@ def test_add_or_update_networks(client):
3839
assert len(response["remotes"]) >= 2
3940
assert REMOTE_MS_2 in response["remotes"]
4041
assert REMOTE_MS_1 in response["remotes"]
42+
43+
disable_sharding(client)

tests/client/test_client_sharding.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

33
from tests.common import BASE_URL, REMOTE_MS_1
4+
from tests.test_utils import disable_sharding
45

56

67
@pytest.mark.usefixtures("enable_network_options")
@@ -33,3 +34,4 @@ def test_update_and_get_network_settings(client):
3334
== options["remotes"][instance_name]["writeApiKey"]
3435
)
3536
assert response["sharding"] == options["sharding"]
37+
disable_sharding(client)

tests/test_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ def test_iso_to_date_time(iso_date, expected):
3131
def test_iso_to_date_time_invalid_format():
3232
with pytest.raises(ValueError):
3333
iso_to_date_time("2023-07-13T23:37:20Z")
34+
35+
36+
def disable_sharding(client):
37+
client.add_or_update_networks(body={"sharding": False})

0 commit comments

Comments
 (0)