@@ -262,7 +262,7 @@ async def test_vsim_with_scores(d_client):
262
262
assert 0 <= vsim ["elem1" ] <= 1
263
263
264
264
265
- @skip_if_server_version_lt ("7.9 .0" )
265
+ @skip_if_server_version_lt ("8.2 .0" )
266
266
async def test_vsim_with_attribs_attribs_set (d_client ):
267
267
elements_count = 5
268
268
vector_dim = 10
@@ -284,7 +284,7 @@ async def test_vsim_with_attribs_attribs_set(d_client):
284
284
assert vsim ["elem2" ] == attrs_dict
285
285
286
286
287
- @skip_if_server_version_lt ("7.9 .0" )
287
+ @skip_if_server_version_lt ("8.2 .0" )
288
288
async def test_vsim_with_scores_and_attribs_attribs_set (d_client ):
289
289
elements_count = 5
290
290
vector_dim = 10
@@ -317,7 +317,7 @@ async def test_vsim_with_scores_and_attribs_attribs_set(d_client):
317
317
assert vsim ["elem2" ]["attributes" ] == attrs_dict
318
318
319
319
320
- @skip_if_server_version_lt ("7.9 .0" )
320
+ @skip_if_server_version_lt ("8.2 .0" )
321
321
async def test_vsim_with_attribs_attribs_not_set (d_client ):
322
322
elements_count = 20
323
323
vector_dim = 50
@@ -859,6 +859,41 @@ async def test_vrandmember(d_client):
859
859
assert members_list == []
860
860
861
861
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
+
862
897
@skip_if_server_version_lt ("7.9.0" )
863
898
async def test_vset_commands_without_decoding_responces (client ):
864
899
# test vadd
@@ -897,28 +932,6 @@ async def test_vset_commands_without_decoding_responces(client):
897
932
assert isinstance (vsim_with_scores , dict )
898
933
assert isinstance (vsim_with_scores [b"elem1" ], float )
899
934
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
-
922
935
# test vlinks - no scores
923
936
element_links_all_layers = await client .vset ().vlinks ("myset" , "elem1" )
924
937
assert len (element_links_all_layers ) >= 1
0 commit comments