@@ -158,34 +158,26 @@ def test_results_range_start_and_end():
158
158
159
159
@responses .activate
160
160
def test_search_delete_failure ():
161
- responses .add ('DELETE' , DELETE_SEARCH , status = 404 ,
162
- json = {})
163
- with pytest . raises ( ArielError , match = 'Ariel search {0} could not be deleted'
161
+ responses .add ('DELETE' , DELETE_SEARCH , status = 500 )
162
+ with pytest . raises ( ArielError ,
163
+ match = 'Ariel search {0} could not be deleted: HTTP 500 was returned '
164
164
.format (SEARCH_ID )):
165
165
ArielSearch ().delete (SEARCH_ID )
166
166
167
167
@responses .activate
168
168
def test_search_delete_success ():
169
- responses .add ('DELETE' , DELETE_SEARCH , status = 200 ,
170
- json = {'status' : 'COMPLETED' , 'search_id' : SEARCH_ID })
171
- status , search_id = ArielSearch ().delete (SEARCH_ID )
172
-
173
- assert status == 'COMPLETED'
174
- assert search_id == SEARCH_ID
169
+ responses .add ('DELETE' , DELETE_SEARCH , status = 202 , json = {'status' : 'COMPLETED' })
170
+ assert ArielSearch ().delete (SEARCH_ID ) == 'COMPLETED'
175
171
176
172
@responses .activate
177
173
def test_search_cancel_failure ():
178
- responses .add ('POST' , CANCEL_SEARCH , status = 404 ,
179
- json = {})
180
- with pytest . raises ( ArielError , match = 'Ariel search {0} could not be cancelled'
174
+ responses .add ('POST' , CANCEL_SEARCH , status = 500 )
175
+ with pytest . raises ( ArielError ,
176
+ match = 'Ariel search {0} could not be cancelled: HTTP 500 was returned '
181
177
.format (SEARCH_ID )):
182
178
ArielSearch ().cancel (SEARCH_ID )
183
179
184
180
@responses .activate
185
181
def test_search_cancel_success ():
186
- responses .add ('POST' , CANCEL_SEARCH , status = 200 ,
187
- json = {'status' : 'COMPLETED' , 'search_id' : SEARCH_ID })
188
- status , search_id = ArielSearch ().cancel (SEARCH_ID )
189
-
190
- assert status == 'COMPLETED'
191
- assert search_id == SEARCH_ID
182
+ responses .add ('POST' , CANCEL_SEARCH , status = 200 , json = {'status' : 'COMPLETED' })
183
+ assert ArielSearch ().cancel (SEARCH_ID ) == 'COMPLETED'
0 commit comments