diff --git a/hazelcast/__init__.py b/hazelcast/__init__.py index f23f91b98c..d40f2659da 100644 --- a/hazelcast/__init__.py +++ b/hazelcast/__init__.py @@ -1,4 +1,4 @@ -__version__ = "5.5.0" +__version__ = "6.0.0" # Set the default handler to "hazelcast" loggers # to avoid "No handlers could be found" warnings. diff --git a/tests/integration/backward_compatible/proxy/vector_collection_test.py b/tests/integration/backward_compatible/proxy/vector_collection_test.py index bef3d569eb..7fc72e8568 100644 --- a/tests/integration/backward_compatible/proxy/vector_collection_test.py +++ b/tests/integration/backward_compatible/proxy/vector_collection_test.py @@ -174,14 +174,31 @@ def test_size(self): self.vector_collection.clear() self.assertEqual(self.vector_collection.size(), 0) - def test_backupCount_valid_values_pass(self): + def test_backup_count_valid_values_pass(self): skip_if_client_version_older_than(self, "6.0") name = random_string() self.client.create_vector_collection_config( name, [IndexConfig("vector", Metric.COSINE, 3)], backup_count=2, async_backup_count=2 ) + self.client.get_vector_collection(name).blocking() - def test_backupCount(self): + def test_backup_count_max_value_pass(self): + skip_if_client_version_older_than(self, "6.0") + name = random_string() + self.client.create_vector_collection_config( + name, [IndexConfig("vector", Metric.COSINE, 3)], backup_count=6 + ) + self.client.get_vector_collection(name).blocking() + + def test_backup_count_min_value_pass(self): + skip_if_client_version_older_than(self, "6.0") + name = random_string() + self.client.create_vector_collection_config( + name, [IndexConfig("vector", Metric.COSINE, 3)], backup_count=0 + ) + self.client.get_vector_collection(name).blocking() + + def test_backup_count_more_than_max_value_fail(self): skip_if_server_version_older_than(self, self.client, "6.0") name = random_string() # check that the parameter is used by ensuring that it is validated on server side @@ -194,7 +211,34 @@ def test_backupCount(self): async_backup_count=0, ) - def test_asyncBackupCount(self): + def test_backup_count_less_than_min_value_fail(self): + skip_if_server_version_older_than(self, self.client, "6.0") + name = random_string() + with self.assertRaises(hazelcast.errors.IllegalArgumentError): + self.client.create_vector_collection_config( + name, [IndexConfig("vector", Metric.COSINE, 3)], backup_count=-1 + ) + + def test_async_backup_count_max_value_pass(self): + skip_if_client_version_older_than(self, "6.0") + name = random_string() + self.client.create_vector_collection_config( + name, + [IndexConfig("vector", Metric.COSINE, 3)], + backup_count=0, + async_backup_count=6, + ) + self.client.get_vector_collection(name).blocking() + + def test_async_backup_count_min_value_pass(self): + skip_if_client_version_older_than(self, "6.0") + name = random_string() + self.client.create_vector_collection_config( + name, [IndexConfig("vector", Metric.COSINE, 3)], async_backup_count=0 + ) + self.client.get_vector_collection(name).blocking() + + def test_async_backup_count_more_than_max_value_fail(self): skip_if_server_version_older_than(self, self.client, "6.0") name = random_string() # check that the parameter is used by ensuring that it is validated on server side @@ -207,6 +251,27 @@ def test_asyncBackupCount(self): async_backup_count=7, ) + def test_async_backup_count_less_than_min_value_fail(self): + skip_if_server_version_older_than(self, self.client, "6.0") + name = random_string() + with self.assertRaises(hazelcast.errors.IllegalArgumentError): + self.client.create_vector_collection_config( + name, + [IndexConfig("vector", Metric.COSINE, 3)], + async_backup_count=-1, + ) + + def test_sync_and_async_backup_count_more_than_max_value_fail(self): + skip_if_server_version_older_than(self, self.client, "6.0") + name = random_string() + with self.assertRaises(hazelcast.errors.IllegalArgumentError): + self.client.create_vector_collection_config( + name, + [IndexConfig("vector", Metric.COSINE, 3)], + backup_count=4, + async_backup_count=3, + ) + def assert_document_equal(self, doc1, doc2) -> None: self.assertEqual(doc1.value, doc2.value) self.assertEqual(len(doc1.vectors), len(doc2.vectors))