@@ -262,7 +262,7 @@ async def test_vsim_with_scores(d_client):
262262 assert 0 <= vsim ["elem1" ] <= 1
263263
264264
265- @skip_if_server_version_lt ("7.9 .0" )
265+ @skip_if_server_version_lt ("8.2 .0" )
266266async def test_vsim_with_attribs_attribs_set (d_client ):
267267 elements_count = 5
268268 vector_dim = 10
@@ -284,7 +284,7 @@ async def test_vsim_with_attribs_attribs_set(d_client):
284284 assert vsim ["elem2" ] == attrs_dict
285285
286286
287- @skip_if_server_version_lt ("7.9 .0" )
287+ @skip_if_server_version_lt ("8.2 .0" )
288288async def test_vsim_with_scores_and_attribs_attribs_set (d_client ):
289289 elements_count = 5
290290 vector_dim = 10
@@ -317,7 +317,7 @@ async def test_vsim_with_scores_and_attribs_attribs_set(d_client):
317317 assert vsim ["elem2" ]["attributes" ] == attrs_dict
318318
319319
320- @skip_if_server_version_lt ("7.9 .0" )
320+ @skip_if_server_version_lt ("8.2 .0" )
321321async def test_vsim_with_attribs_attribs_not_set (d_client ):
322322 elements_count = 20
323323 vector_dim = 50
@@ -859,6 +859,41 @@ async def test_vrandmember(d_client):
859859 assert members_list == []
860860
861861
862+ @skip_if_server_version_lt ("8.2.0" )
863+ async def test_8_2_new_vset_features_without_decoding_responces (client ):
864+ # test vadd
865+ elements = ["elem1" , "elem2" , "elem3" ]
866+ attrs_dict = {"key1" : "value1" , "key2" : "value2" }
867+ for elem in elements :
868+ float_array = [random .uniform (0.5 , 10 ) for x in range (0 , 8 )]
869+ resp = await client .vset ().vadd (
870+ "myset" , float_array , element = elem , attributes = attrs_dict
871+ )
872+ assert resp == 1
873+
874+ # test vsim with attributes
875+ vsim_with_attribs = await client .vset ().vsim (
876+ "myset" , input = "elem1" , with_attribs = True
877+ )
878+ assert len (vsim_with_attribs ) == 3
879+ assert isinstance (vsim_with_attribs , dict )
880+ assert isinstance (vsim_with_attribs [b"elem1" ], dict )
881+ assert vsim_with_attribs [b"elem1" ] == attrs_dict
882+
883+ # test vsim with score and attributes
884+ vsim_with_scores_and_attribs = await client .vset ().vsim (
885+ "myset" , input = "elem1" , with_scores = True , with_attribs = True
886+ )
887+ assert len (vsim_with_scores_and_attribs ) == 3
888+ assert isinstance (vsim_with_scores_and_attribs , dict )
889+ assert isinstance (vsim_with_scores_and_attribs [b"elem1" ], dict )
890+ assert "score" in vsim_with_scores_and_attribs [b"elem1" ]
891+ assert "attributes" in vsim_with_scores_and_attribs [b"elem1" ]
892+ assert isinstance (vsim_with_scores_and_attribs [b"elem1" ]["score" ], float )
893+ assert isinstance (vsim_with_scores_and_attribs [b"elem1" ]["attributes" ], dict )
894+ assert vsim_with_scores_and_attribs [b"elem1" ]["attributes" ] == attrs_dict
895+
896+
862897@skip_if_server_version_lt ("7.9.0" )
863898async def test_vset_commands_without_decoding_responces (client ):
864899 # test vadd
@@ -897,28 +932,6 @@ async def test_vset_commands_without_decoding_responces(client):
897932 assert isinstance (vsim_with_scores , dict )
898933 assert isinstance (vsim_with_scores [b"elem1" ], float )
899934
900- # test vsim with attributes
901- vsim_with_attribs = await client .vset ().vsim (
902- "myset" , input = "elem1" , with_attribs = True
903- )
904- assert len (vsim_with_attribs ) == 3
905- assert isinstance (vsim_with_attribs , dict )
906- assert isinstance (vsim_with_attribs [b"elem1" ], dict )
907- assert vsim_with_attribs [b"elem1" ] == attrs_dict
908-
909- # test vsim with score and attributes
910- vsim_with_scores_and_attribs = await client .vset ().vsim (
911- "myset" , input = "elem1" , with_scores = True , with_attribs = True
912- )
913- assert len (vsim_with_scores_and_attribs ) == 3
914- assert isinstance (vsim_with_scores_and_attribs , dict )
915- assert isinstance (vsim_with_scores_and_attribs [b"elem1" ], dict )
916- assert "score" in vsim_with_scores_and_attribs [b"elem1" ]
917- assert "attributes" in vsim_with_scores_and_attribs [b"elem1" ]
918- assert isinstance (vsim_with_scores_and_attribs [b"elem1" ]["score" ], float )
919- assert isinstance (vsim_with_scores_and_attribs [b"elem1" ]["attributes" ], dict )
920- assert vsim_with_scores_and_attribs [b"elem1" ]["attributes" ] == attrs_dict
921-
922935 # test vlinks - no scores
923936 element_links_all_layers = await client .vset ().vlinks ("myset" , "elem1" )
924937 assert len (element_links_all_layers ) >= 1
0 commit comments