@@ -174,14 +174,31 @@ def test_size(self):
174
174
self .vector_collection .clear ()
175
175
self .assertEqual (self .vector_collection .size (), 0 )
176
176
177
- def test_backupCount_valid_values_pass (self ):
177
+ def test_backup_count_valid_values_pass (self ):
178
178
skip_if_client_version_older_than (self , "6.0" )
179
179
name = random_string ()
180
180
self .client .create_vector_collection_config (
181
181
name , [IndexConfig ("vector" , Metric .COSINE , 3 )], backup_count = 2 , async_backup_count = 2
182
182
)
183
+ self .client .get_vector_collection (name ).blocking ()
183
184
184
- def test_backupCount (self ):
185
+ def test_backup_count_max_value_pass (self ):
186
+ skip_if_client_version_older_than (self , "6.0" )
187
+ name = random_string ()
188
+ self .client .create_vector_collection_config (
189
+ name , [IndexConfig ("vector" , Metric .COSINE , 3 )], backup_count = 6
190
+ )
191
+ self .client .get_vector_collection (name ).blocking ()
192
+
193
+ def test_backup_count_min_value_pass (self ):
194
+ skip_if_client_version_older_than (self , "6.0" )
195
+ name = random_string ()
196
+ self .client .create_vector_collection_config (
197
+ name , [IndexConfig ("vector" , Metric .COSINE , 3 )], backup_count = 0
198
+ )
199
+ self .client .get_vector_collection (name ).blocking ()
200
+
201
+ def test_backup_count_more_than_max_value_fail (self ):
185
202
skip_if_server_version_older_than (self , self .client , "6.0" )
186
203
name = random_string ()
187
204
# check that the parameter is used by ensuring that it is validated on server side
@@ -194,7 +211,34 @@ def test_backupCount(self):
194
211
async_backup_count = 0 ,
195
212
)
196
213
197
- def test_asyncBackupCount (self ):
214
+ def test_backup_count_less_than_min_value_fail (self ):
215
+ skip_if_server_version_older_than (self , self .client , "6.0" )
216
+ name = random_string ()
217
+ with self .assertRaises (hazelcast .errors .IllegalArgumentError ):
218
+ self .client .create_vector_collection_config (
219
+ name , [IndexConfig ("vector" , Metric .COSINE , 3 )], backup_count = - 1
220
+ )
221
+
222
+ def test_async_backup_count_max_value_pass (self ):
223
+ skip_if_client_version_older_than (self , "6.0" )
224
+ name = random_string ()
225
+ self .client .create_vector_collection_config (
226
+ name ,
227
+ [IndexConfig ("vector" , Metric .COSINE , 3 )],
228
+ backup_count = 0 ,
229
+ async_backup_count = 6 ,
230
+ )
231
+ self .client .get_vector_collection (name ).blocking ()
232
+
233
+ def test_async_backup_count_min_value_pass (self ):
234
+ skip_if_client_version_older_than (self , "6.0" )
235
+ name = random_string ()
236
+ self .client .create_vector_collection_config (
237
+ name , [IndexConfig ("vector" , Metric .COSINE , 3 )], async_backup_count = 0
238
+ )
239
+ self .client .get_vector_collection (name ).blocking ()
240
+
241
+ def test_async_backup_count_more_than_max_value_fail (self ):
198
242
skip_if_server_version_older_than (self , self .client , "6.0" )
199
243
name = random_string ()
200
244
# check that the parameter is used by ensuring that it is validated on server side
@@ -207,6 +251,27 @@ def test_asyncBackupCount(self):
207
251
async_backup_count = 7 ,
208
252
)
209
253
254
+ def test_async_backup_count_less_than_min_value_fail (self ):
255
+ skip_if_server_version_older_than (self , self .client , "6.0" )
256
+ name = random_string ()
257
+ with self .assertRaises (hazelcast .errors .IllegalArgumentError ):
258
+ self .client .create_vector_collection_config (
259
+ name ,
260
+ [IndexConfig ("vector" , Metric .COSINE , 3 )],
261
+ async_backup_count = - 1 ,
262
+ )
263
+
264
+ def test_sync_and_async_backup_count_more_than_max_value_fail (self ):
265
+ skip_if_server_version_older_than (self , self .client , "6.0" )
266
+ name = random_string ()
267
+ with self .assertRaises (hazelcast .errors .IllegalArgumentError ):
268
+ self .client .create_vector_collection_config (
269
+ name ,
270
+ [IndexConfig ("vector" , Metric .COSINE , 3 )],
271
+ backup_count = 4 ,
272
+ async_backup_count = 3 ,
273
+ )
274
+
210
275
def assert_document_equal (self , doc1 , doc2 ) -> None :
211
276
self .assertEqual (doc1 .value , doc2 .value )
212
277
self .assertEqual (len (doc1 .vectors ), len (doc2 .vectors ))
0 commit comments