Skip to content

Commit 57d7b4f

Browse files
author
roxanne-o
committed
fix test
1 parent 1917212 commit 57d7b4f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/integration/test_groundlight.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff 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):

0 commit comments

Comments
 (0)