@@ -913,20 +913,21 @@ async def test_generate_access_token_async_use_cached_wrapped_rpc(transport: str
913913 assert client ._client ._transport .generate_access_token in client ._client ._transport ._wrapped_methods
914914
915915 # Replace cached wrapped function with mock
916- mock_object = mock .AsyncMock ()
917- client ._client ._transport ._wrapped_methods [client ._client ._transport .generate_access_token ] = mock_object
916+ mock_rpc = mock .AsyncMock ()
917+ mock_rpc .return_value = mock .Mock ()
918+ client ._client ._transport ._wrapped_methods [client ._client ._transport .generate_access_token ] = mock_rpc
918919
919920 request = {}
920921 await client .generate_access_token (request )
921922
922923 # Establish that the underlying gRPC stub method was called.
923- assert mock_object .call_count == 1
924+ assert mock_rpc .call_count == 1
924925
925926 await client .generate_access_token (request )
926927
927928 # Establish that a new wrapper was not created for this call
928929 assert wrapper_fn .call_count == 0
929- assert mock_object .call_count == 2
930+ assert mock_rpc .call_count == 2
930931
931932@pytest .mark .asyncio
932933async def test_generate_access_token_async (transport : str = 'grpc_asyncio' , request_type = common .GenerateAccessTokenRequest ):
@@ -1291,20 +1292,21 @@ async def test_generate_id_token_async_use_cached_wrapped_rpc(transport: str = "
12911292 assert client ._client ._transport .generate_id_token in client ._client ._transport ._wrapped_methods
12921293
12931294 # Replace cached wrapped function with mock
1294- mock_object = mock .AsyncMock ()
1295- client ._client ._transport ._wrapped_methods [client ._client ._transport .generate_id_token ] = mock_object
1295+ mock_rpc = mock .AsyncMock ()
1296+ mock_rpc .return_value = mock .Mock ()
1297+ client ._client ._transport ._wrapped_methods [client ._client ._transport .generate_id_token ] = mock_rpc
12961298
12971299 request = {}
12981300 await client .generate_id_token (request )
12991301
13001302 # Establish that the underlying gRPC stub method was called.
1301- assert mock_object .call_count == 1
1303+ assert mock_rpc .call_count == 1
13021304
13031305 await client .generate_id_token (request )
13041306
13051307 # Establish that a new wrapper was not created for this call
13061308 assert wrapper_fn .call_count == 0
1307- assert mock_object .call_count == 2
1309+ assert mock_rpc .call_count == 2
13081310
13091311@pytest .mark .asyncio
13101312async def test_generate_id_token_async (transport : str = 'grpc_asyncio' , request_type = common .GenerateIdTokenRequest ):
@@ -1674,20 +1676,21 @@ async def test_sign_blob_async_use_cached_wrapped_rpc(transport: str = "grpc_asy
16741676 assert client ._client ._transport .sign_blob in client ._client ._transport ._wrapped_methods
16751677
16761678 # Replace cached wrapped function with mock
1677- mock_object = mock .AsyncMock ()
1678- client ._client ._transport ._wrapped_methods [client ._client ._transport .sign_blob ] = mock_object
1679+ mock_rpc = mock .AsyncMock ()
1680+ mock_rpc .return_value = mock .Mock ()
1681+ client ._client ._transport ._wrapped_methods [client ._client ._transport .sign_blob ] = mock_rpc
16791682
16801683 request = {}
16811684 await client .sign_blob (request )
16821685
16831686 # Establish that the underlying gRPC stub method was called.
1684- assert mock_object .call_count == 1
1687+ assert mock_rpc .call_count == 1
16851688
16861689 await client .sign_blob (request )
16871690
16881691 # Establish that a new wrapper was not created for this call
16891692 assert wrapper_fn .call_count == 0
1690- assert mock_object .call_count == 2
1693+ assert mock_rpc .call_count == 2
16911694
16921695@pytest .mark .asyncio
16931696async def test_sign_blob_async (transport : str = 'grpc_asyncio' , request_type = common .SignBlobRequest ):
@@ -2051,20 +2054,21 @@ async def test_sign_jwt_async_use_cached_wrapped_rpc(transport: str = "grpc_asyn
20512054 assert client ._client ._transport .sign_jwt in client ._client ._transport ._wrapped_methods
20522055
20532056 # Replace cached wrapped function with mock
2054- mock_object = mock .AsyncMock ()
2055- client ._client ._transport ._wrapped_methods [client ._client ._transport .sign_jwt ] = mock_object
2057+ mock_rpc = mock .AsyncMock ()
2058+ mock_rpc .return_value = mock .Mock ()
2059+ client ._client ._transport ._wrapped_methods [client ._client ._transport .sign_jwt ] = mock_rpc
20562060
20572061 request = {}
20582062 await client .sign_jwt (request )
20592063
20602064 # Establish that the underlying gRPC stub method was called.
2061- assert mock_object .call_count == 1
2065+ assert mock_rpc .call_count == 1
20622066
20632067 await client .sign_jwt (request )
20642068
20652069 # Establish that a new wrapper was not created for this call
20662070 assert wrapper_fn .call_count == 0
2067- assert mock_object .call_count == 2
2071+ assert mock_rpc .call_count == 2
20682072
20692073@pytest .mark .asyncio
20702074async def test_sign_jwt_async (transport : str = 'grpc_asyncio' , request_type = common .SignJwtRequest ):
0 commit comments