Skip to content

Commit

Permalink
fixing exception for updating metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Huff committed Aug 11, 2023
1 parent e19fc78 commit 1208788
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/groundlight/internalapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,7 @@ def update_inspection_metadata(self, inspection_id: str, user_provided_key: str,
http_resp=response,
)
if response.json()["status"] == "COMPLETE":
raise InternalApiError(
# status=response.status_code,
reason=f"Inspection {inspection_id} is closed. Metadata cannot be added.",
)
raise ValueError(f"Inspection {inspection_id} is closed. Metadata cannot be added.")

payload = {}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_groundlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def test_update_inspection_metadata_failure(gl: Groundlight):

_ = gl.stop_inspection(inspection_id)

with pytest.raises(InternalApiError):
with pytest.raises(ValueError):
user_provided_key = "Inspector"
user_provided_value = "Bob"
gl.update_inspection_metadata(inspection_id, user_provided_key, user_provided_value)
Expand Down

0 comments on commit 1208788

Please sign in to comment.