@@ -302,9 +302,9 @@ def test_error_details_from_rest_response():
302302
303303 # See JSON schema in https://cloud.google.com/apis/design/errors#http_mapping
304304 http_response = make_response (
305- json .dumps ({ "error" : json . loads ( json_format . MessageToJson ( status , sort_keys = True ))}). encode (
306- "utf-8"
307- )
305+ json .dumps (
306+ { "error" : json . loads ( json_format . MessageToJson ( status , sort_keys = True ))}
307+ ). encode ( "utf-8" )
308308 )
309309 exception = exceptions .from_http_response (http_response )
310310 want_error_details = [
@@ -336,7 +336,11 @@ def test_error_details_from_v1_rest_response():
336336 )
337337 exception = exceptions .from_http_response (response )
338338 assert exception .details == []
339- assert exception .error_info is None
339+ assert (
340+ exception .reason is None
341+ and exception .domain is None
342+ and exception .metadata is None
343+ )
340344
341345
342346@pytest .mark .skipif (grpc is None , reason = "gRPC not importable" )
@@ -362,7 +366,9 @@ def test_error_details_from_grpc_response():
362366 status_br_detail .Unpack (bad_request_detail )
363367 status_ei_detail .Unpack (error_info_detail )
364368 assert exception .details == [bad_request_detail , error_info_detail ]
365- assert exception .error_info == error_info_detail
369+ assert exception .reason == error_info_detail .reason
370+ assert exception .domain == error_info_detail .domain
371+ assert exception .metadata == error_info_detail .metadata
366372
367373
368374@pytest .mark .skipif (grpc is None , reason = "gRPC not importable" )
@@ -381,4 +387,8 @@ def test_error_details_from_grpc_response_unknown_error():
381387 m .return_value = status
382388 exception = exceptions .from_grpc_error (error )
383389 assert exception .details == [status_detail ]
384- assert exception .error_info is None
390+ assert (
391+ exception .reason is None
392+ and exception .domain is None
393+ and exception .metadata is None
394+ )
0 commit comments