def mock_google_error(status): mock_resp = mock.Mock(spec=Response) mock_resp.status = status return google_errors.HttpError(mock_resp, b'')
def _http_exception(status_code): mock_resp = mock.Mock() mock_resp.status = status_code return google_errors.HttpError(mock_resp, b'')