File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -877,8 +877,12 @@ def test_delete_detector(gl: Groundlight):
877877 gl .delete_detector (detector )
878878
879879 # Verify the detector is actually deleted
880- with pytest .raises (NotFoundError ) :
880+ with pytest .raises (ApiException ) as exc_info :
881881 gl .get_detector (detector .id )
882+ err = exc_info .value
883+ assert err .status == HTTPStatus .GONE
884+ payload = json .loads (err .body )
885+ assert det_id in payload .get ("message" , "" )
882886
883887 # Create another detector to test deletion by ID string and that an attached image query is deleted
884888 name2 = f"Test delete detector 2 { datetime .utcnow ()} "
@@ -891,8 +895,12 @@ def test_delete_detector(gl: Groundlight):
891895 gl .delete_detector (detector2 .id )
892896
893897 # Verify the second detector is also deleted
894- with pytest .raises (NotFoundError ) :
898+ with pytest .raises (ApiException ) as exc_info :
895899 gl .get_detector (detector2 .id )
900+ err = exc_info .value
901+ assert err .status == HTTPStatus .GONE
902+ payload = json .loads (err .body )
903+ assert det_id in payload .get ("message" , "" )
896904
897905 # Verify the image query is also deleted
898906 with pytest .raises (NotFoundException ):
You can’t perform that action at this time.
0 commit comments