File tree 1 file changed +12
-0
lines changed
test_opensearchpy/test_server
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,18 @@ def test_bulk_works_with_bytestring_body(self) -> None:
110
110
self .assertFalse (response ["errors" ])
111
111
self .assertEqual (1 , len (response ["items" ]))
112
112
113
+ def test_bulk_works_with_delete (self ) -> None :
114
+ docs = '{ "index" : { "_index" : "bulk_test_index", "_id" : "1" } }\n {"answer": 42}\n { "delete" : { "_index" : "bulk_test_index", "_id": "1" } }'
115
+ response = self .client .bulk (body = docs )
116
+
117
+ self .assertFalse (response ["errors" ])
118
+ self .assertEqual (2 , len (response ["items" ]))
119
+
120
+ # Check insertion status
121
+ self .assertEqual (201 , response ["items" ][0 ]["index" ]["status" ])
122
+ # Check deletion status
123
+ self .assertEqual (200 , response ["items" ][1 ]["delete" ]["status" ])
124
+
113
125
114
126
class TestClose (OpenSearchTestCase ):
115
127
def test_close_doesnt_break_client (self ) -> None :
You can’t perform that action at this time.
0 commit comments