@@ -648,6 +648,23 @@ def batch_operations_synchronous_mode(
648
648
expected_updated_fields .update (fields_to_update [idx ])
649
649
self .assertDictEqual (response .json ["fields" ], expected_updated_fields )
650
650
651
+ #
652
+ # Delete data
653
+ #
654
+ result = app .delete_batch (schema = schema , batch = docs , asynchronous = False )
655
+ for idx , response in enumerate (result ):
656
+ self .assertEqual (
657
+ response .json ["id" ],
658
+ "id:{}:{}::{}" .format (schema , schema , docs [idx ]["id" ]),
659
+ )
660
+
661
+ #
662
+ # get batch deleted data
663
+ #
664
+ result = app .get_batch (schema = schema , batch = docs , asynchronous = False )
665
+ for idx , response in enumerate (result ):
666
+ self .assertEqual (response .status_code , 404 )
667
+
651
668
def batch_operations_asynchronous_mode (
652
669
self ,
653
670
app ,
@@ -724,6 +741,23 @@ def batch_operations_asynchronous_mode(
724
741
expected_updated_fields .update (fields_to_update [idx ])
725
742
self .assertDictEqual (response .json ["fields" ], expected_updated_fields )
726
743
744
+ #
745
+ # Delete data
746
+ #
747
+ result = app .delete_batch (schema = schema , batch = docs , asynchronous = True )
748
+ for idx , response in enumerate (result ):
749
+ self .assertEqual (
750
+ response .json ["id" ],
751
+ "id:{}:{}::{}" .format (schema , schema , docs [idx ]["id" ]),
752
+ )
753
+
754
+ #
755
+ # get batch deleted data
756
+ #
757
+ result = app .get_batch (schema = schema , batch = docs , asynchronous = True )
758
+ for idx , response in enumerate (result ):
759
+ self .assertEqual (response .status_code , 404 )
760
+
727
761
@staticmethod
728
762
def _parse_vespa_tensor (hit , feature ):
729
763
return [x ["value" ] for x in hit ["fields" ]["summaryfeatures" ][feature ]["cells" ]]
@@ -911,7 +945,7 @@ def test_batch_operations_synchronous_mode(self):
911
945
schema_name = self .app_package .name ,
912
946
fields_to_send = self .fields_to_send ,
913
947
expected_fields_from_get_operation = self .fields_to_send ,
914
- fields_to_update = self .fields_to_update
948
+ fields_to_update = self .fields_to_update ,
915
949
)
916
950
917
951
def test_batch_operations_asynchronous_mode (self ):
@@ -1004,7 +1038,7 @@ def test_batch_operations_synchronous_mode(self):
1004
1038
schema_name = self .app_package .name ,
1005
1039
fields_to_send = self .fields_to_send ,
1006
1040
expected_fields_from_get_operation = self .expected_fields_from_get_operation ,
1007
- fields_to_update = self .fields_to_update
1041
+ fields_to_update = self .fields_to_update ,
1008
1042
)
1009
1043
1010
1044
def test_batch_operations_asynchronous_mode (self ):
@@ -1113,7 +1147,7 @@ def test_batch_operations_synchronous_mode(self):
1113
1147
schema_name = "sentence" ,
1114
1148
fields_to_send = self .fields_to_send_sentence ,
1115
1149
expected_fields_from_get_operation = self .expected_fields_from_sentence_get_operation ,
1116
- fields_to_update = self .fields_to_update
1150
+ fields_to_update = self .fields_to_update ,
1117
1151
)
1118
1152
1119
1153
def test_batch_operations_asynchronous_mode (self ):
0 commit comments