def METHOD_NAME(response, expected_error):
    predict_raw_response = RawResponseMock(*response)
    predict_response = HttpPredictResponse(predict_raw_response)
    with pytest.raises(expected_error):
        predict_response.to_dict()