diff --git a/api/test/test_covjson.py b/api/test/test_covjson.py index ac2d980f..28545411 100644 --- a/api/test/test_covjson.py +++ b/api/test/test_covjson.py @@ -94,10 +94,14 @@ def test_empty_response_convert(): test_data = load_json("test/test_data/test_empty_proto.json") response = create_mock_obs_response(test_data) - # Expect to get an HTTPException when converting an empty response - with pytest.raises(HTTPException): + # Expect to get an HTTPException with status code of 404 and detail of + # "No data found" when converting an empty response + with pytest.raises(HTTPException) as exception_info: Covjson().convert(response) + assert exception_info.value.detail == "No data found" + assert exception_info.value.status_code == 404 + def create_mock_obs_response(json_data): response = dstore.GetObsResponse()