11import pytest
22
33from 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" )
@@ -16,15 +17,27 @@ def test_add_or_update_networks(client):
1617 """Tests upsert network remote instance."""
1718 body = {
1819 "self" : REMOTE_MS_1 ,
20+ "sharding" : True ,
1921 "remotes" : {
20- REMOTE_MS_1 : {"url" : "http://localhost:7700" , "searchApiKey" : "xxxxxxxxxxxxxx" },
21- REMOTE_MS_2 : {"url" : "http://localhost:7720" , "searchApiKey" : "xxxxxxxxxxxxxxx" },
22+ REMOTE_MS_1 : {
23+ "url" : "http://localhost:7700" ,
24+ "searchApiKey" : "xxxxxxxxxxxxxx" ,
25+ "writeApiKey" : "xxxxxxxxx" ,
26+ },
27+ REMOTE_MS_2 : {
28+ "url" : "http://localhost:7720" ,
29+ "searchApiKey" : "xxxxxxxxxxxxxxx" ,
30+ "writeApiKey" : "xxxxxxxx" ,
31+ },
2232 },
2333 }
2434 response = client .add_or_update_networks (body = body )
2535
2636 assert isinstance (response , dict )
2737 assert response ["self" ] == REMOTE_MS_1
38+ assert response ["sharding" ] is True
2839 assert len (response ["remotes" ]) >= 2
2940 assert REMOTE_MS_2 in response ["remotes" ]
3041 assert REMOTE_MS_1 in response ["remotes" ]
42+
43+ disable_sharding (client )
0 commit comments