From ab3100964776a52d0c272ed3bbd2e66ad8e4cba3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 07:23:12 -0400 Subject: [PATCH] chore: use gapic-generator-python 0.65.2 (#37) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/content_service/async_client.py | 30 +- .../services/dataplex_service/async_client.py | 192 ++++++------ .../services/metadata_service/async_client.py | 54 ++-- .../gapic/dataplex_v1/test_content_service.py | 42 +-- .../dataplex_v1/test_dataplex_service.py | 276 +++++++++--------- .../dataplex_v1/test_metadata_service.py | 76 ++--- 6 files changed, 335 insertions(+), 335 deletions(-) diff --git a/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/content_service/async_client.py b/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/content_service/async_client.py index a10a614c0d5c..75122d56f458 100644 --- a/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/content_service/async_client.py +++ b/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/content_service/async_client.py @@ -226,9 +226,9 @@ async def create_content( from google.cloud import dataplex_v1 - def sample_create_content(): + async def sample_create_content(): # Create a client - client = dataplex_v1.ContentServiceClient() + client = dataplex_v1.ContentServiceAsyncClient() # Initialize request argument(s) content = dataplex_v1.Content() @@ -242,7 +242,7 @@ def sample_create_content(): ) # Make the request - response = client.create_content(request=request) + response = await client.create_content(request=request) # Handle the response print(response) @@ -334,9 +334,9 @@ async def update_content( from google.cloud import dataplex_v1 - def sample_update_content(): + async def sample_update_content(): # Create a client - client = dataplex_v1.ContentServiceClient() + client = dataplex_v1.ContentServiceAsyncClient() # Initialize request argument(s) content = dataplex_v1.Content() @@ -349,7 +349,7 @@ def sample_update_content(): ) # Make the request - response = client.update_content(request=request) + response = await client.update_content(request=request) # Handle the response print(response) @@ -442,9 +442,9 @@ async def delete_content( from google.cloud import dataplex_v1 - def sample_delete_content(): + async def sample_delete_content(): # Create a client - client = dataplex_v1.ContentServiceClient() + client = dataplex_v1.ContentServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteContentRequest( @@ -452,7 +452,7 @@ def sample_delete_content(): ) # Make the request - client.delete_content(request=request) + await client.delete_content(request=request) Args: request (Union[google.cloud.dataplex_v1.types.DeleteContentRequest, dict]): @@ -524,9 +524,9 @@ async def get_content( from google.cloud import dataplex_v1 - def sample_get_content(): + async def sample_get_content(): # Create a client - client = dataplex_v1.ContentServiceClient() + client = dataplex_v1.ContentServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetContentRequest( @@ -534,7 +534,7 @@ def sample_get_content(): ) # Make the request - response = client.get_content(request=request) + response = await client.get_content(request=request) # Handle the response print(response) @@ -618,9 +618,9 @@ async def list_content( from google.cloud import dataplex_v1 - def sample_list_content(): + async def sample_list_content(): # Create a client - client = dataplex_v1.ContentServiceClient() + client = dataplex_v1.ContentServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListContentRequest( @@ -631,7 +631,7 @@ def sample_list_content(): page_result = client.list_content(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/dataplex_service/async_client.py b/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/dataplex_service/async_client.py index abc81a409225..41fa2374066e 100644 --- a/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/dataplex_service/async_client.py +++ b/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/dataplex_service/async_client.py @@ -246,9 +246,9 @@ async def create_lake( from google.cloud import dataplex_v1 - def sample_create_lake(): + async def sample_create_lake(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.CreateLakeRequest( @@ -261,7 +261,7 @@ def sample_create_lake(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -392,9 +392,9 @@ async def update_lake( from google.cloud import dataplex_v1 - def sample_update_lake(): + async def sample_update_lake(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.UpdateLakeRequest( @@ -405,7 +405,7 @@ def sample_update_lake(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -519,9 +519,9 @@ async def delete_lake( from google.cloud import dataplex_v1 - def sample_delete_lake(): + async def sample_delete_lake(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteLakeRequest( @@ -533,7 +533,7 @@ def sample_delete_lake(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -638,9 +638,9 @@ async def list_lakes( from google.cloud import dataplex_v1 - def sample_list_lakes(): + async def sample_list_lakes(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListLakesRequest( @@ -651,7 +651,7 @@ def sample_list_lakes(): page_result = client.list_lakes(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -755,9 +755,9 @@ async def get_lake( from google.cloud import dataplex_v1 - def sample_get_lake(): + async def sample_get_lake(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetLakeRequest( @@ -765,7 +765,7 @@ def sample_get_lake(): ) # Make the request - response = client.get_lake(request=request) + response = await client.get_lake(request=request) # Handle the response print(response) @@ -872,9 +872,9 @@ async def list_lake_actions( from google.cloud import dataplex_v1 - def sample_list_lake_actions(): + async def sample_list_lake_actions(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListLakeActionsRequest( @@ -885,7 +885,7 @@ def sample_list_lake_actions(): page_result = client.list_lake_actions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -989,9 +989,9 @@ async def create_zone( from google.cloud import dataplex_v1 - def sample_create_zone(): + async def sample_create_zone(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) zone = dataplex_v1.Zone() @@ -1009,7 +1009,7 @@ def sample_create_zone(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1134,9 +1134,9 @@ async def update_zone( from google.cloud import dataplex_v1 - def sample_update_zone(): + async def sample_update_zone(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) zone = dataplex_v1.Zone() @@ -1152,7 +1152,7 @@ def sample_update_zone(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1259,9 +1259,9 @@ async def delete_zone( from google.cloud import dataplex_v1 - def sample_delete_zone(): + async def sample_delete_zone(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteZoneRequest( @@ -1273,7 +1273,7 @@ def sample_delete_zone(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1378,9 +1378,9 @@ async def list_zones( from google.cloud import dataplex_v1 - def sample_list_zones(): + async def sample_list_zones(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListZonesRequest( @@ -1391,7 +1391,7 @@ def sample_list_zones(): page_result = client.list_zones(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1493,9 +1493,9 @@ async def get_zone( from google.cloud import dataplex_v1 - def sample_get_zone(): + async def sample_get_zone(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetZoneRequest( @@ -1503,7 +1503,7 @@ def sample_get_zone(): ) # Make the request - response = client.get_zone(request=request) + response = await client.get_zone(request=request) # Handle the response print(response) @@ -1602,9 +1602,9 @@ async def list_zone_actions( from google.cloud import dataplex_v1 - def sample_list_zone_actions(): + async def sample_list_zone_actions(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListZoneActionsRequest( @@ -1615,7 +1615,7 @@ def sample_list_zone_actions(): page_result = client.list_zone_actions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1719,9 +1719,9 @@ async def create_asset( from google.cloud import dataplex_v1 - def sample_create_asset(): + async def sample_create_asset(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) asset = dataplex_v1.Asset() @@ -1738,7 +1738,7 @@ def sample_create_asset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1857,9 +1857,9 @@ async def update_asset( from google.cloud import dataplex_v1 - def sample_update_asset(): + async def sample_update_asset(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) asset = dataplex_v1.Asset() @@ -1874,7 +1874,7 @@ def sample_update_asset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1979,9 +1979,9 @@ async def delete_asset( from google.cloud import dataplex_v1 - def sample_delete_asset(): + async def sample_delete_asset(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteAssetRequest( @@ -1993,7 +1993,7 @@ def sample_delete_asset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2098,9 +2098,9 @@ async def list_assets( from google.cloud import dataplex_v1 - def sample_list_assets(): + async def sample_list_assets(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListAssetsRequest( @@ -2111,7 +2111,7 @@ def sample_list_assets(): page_result = client.list_assets(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2213,9 +2213,9 @@ async def get_asset( from google.cloud import dataplex_v1 - def sample_get_asset(): + async def sample_get_asset(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetAssetRequest( @@ -2223,7 +2223,7 @@ def sample_get_asset(): ) # Make the request - response = client.get_asset(request=request) + response = await client.get_asset(request=request) # Handle the response print(response) @@ -2317,9 +2317,9 @@ async def list_asset_actions( from google.cloud import dataplex_v1 - def sample_list_asset_actions(): + async def sample_list_asset_actions(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListAssetActionsRequest( @@ -2330,7 +2330,7 @@ def sample_list_asset_actions(): page_result = client.list_asset_actions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2434,9 +2434,9 @@ async def create_task( from google.cloud import dataplex_v1 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) task = dataplex_v1.Task() @@ -2456,7 +2456,7 @@ def sample_create_task(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2566,9 +2566,9 @@ async def update_task( from google.cloud import dataplex_v1 - def sample_update_task(): + async def sample_update_task(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) task = dataplex_v1.Task() @@ -2586,7 +2586,7 @@ def sample_update_task(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2690,9 +2690,9 @@ async def delete_task( from google.cloud import dataplex_v1 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteTaskRequest( @@ -2704,7 +2704,7 @@ def sample_delete_task(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2809,9 +2809,9 @@ async def list_tasks( from google.cloud import dataplex_v1 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListTasksRequest( @@ -2822,7 +2822,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2924,9 +2924,9 @@ async def get_task( from google.cloud import dataplex_v1 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetTaskRequest( @@ -2934,7 +2934,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -3025,9 +3025,9 @@ async def list_jobs( from google.cloud import dataplex_v1 - def sample_list_jobs(): + async def sample_list_jobs(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListJobsRequest( @@ -3038,7 +3038,7 @@ def sample_list_jobs(): page_result = client.list_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -3140,9 +3140,9 @@ async def get_job( from google.cloud import dataplex_v1 - def sample_get_job(): + async def sample_get_job(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetJobRequest( @@ -3150,7 +3150,7 @@ def sample_get_job(): ) # Make the request - response = client.get_job(request=request) + response = await client.get_job(request=request) # Handle the response print(response) @@ -3243,9 +3243,9 @@ async def cancel_job( from google.cloud import dataplex_v1 - def sample_cancel_job(): + async def sample_cancel_job(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.CancelJobRequest( @@ -3253,7 +3253,7 @@ def sample_cancel_job(): ) # Make the request - client.cancel_job(request=request) + await client.cancel_job(request=request) Args: request (Union[google.cloud.dataplex_v1.types.CancelJobRequest, dict]): @@ -3327,9 +3327,9 @@ async def create_environment( from google.cloud import dataplex_v1 - def sample_create_environment(): + async def sample_create_environment(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) environment = dataplex_v1.Environment() @@ -3346,7 +3346,7 @@ def sample_create_environment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3463,9 +3463,9 @@ async def update_environment( from google.cloud import dataplex_v1 - def sample_update_environment(): + async def sample_update_environment(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) environment = dataplex_v1.Environment() @@ -3480,7 +3480,7 @@ def sample_update_environment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3585,9 +3585,9 @@ async def delete_environment( from google.cloud import dataplex_v1 - def sample_delete_environment(): + async def sample_delete_environment(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteEnvironmentRequest( @@ -3599,7 +3599,7 @@ def sample_delete_environment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3704,9 +3704,9 @@ async def list_environments( from google.cloud import dataplex_v1 - def sample_list_environments(): + async def sample_list_environments(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListEnvironmentsRequest( @@ -3717,7 +3717,7 @@ def sample_list_environments(): page_result = client.list_environments(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -3810,9 +3810,9 @@ async def get_environment( from google.cloud import dataplex_v1 - def sample_get_environment(): + async def sample_get_environment(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetEnvironmentRequest( @@ -3820,7 +3820,7 @@ def sample_get_environment(): ) # Make the request - response = client.get_environment(request=request) + response = await client.get_environment(request=request) # Handle the response print(response) @@ -3905,9 +3905,9 @@ async def list_sessions( from google.cloud import dataplex_v1 - def sample_list_sessions(): + async def sample_list_sessions(): # Create a client - client = dataplex_v1.DataplexServiceClient() + client = dataplex_v1.DataplexServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListSessionsRequest( @@ -3918,7 +3918,7 @@ def sample_list_sessions(): page_result = client.list_sessions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/metadata_service/async_client.py b/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/metadata_service/async_client.py index 34893958f514..d67ef53d4dd8 100644 --- a/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/metadata_service/async_client.py +++ b/packages/google-cloud-dataplex/google/cloud/dataplex_v1/services/metadata_service/async_client.py @@ -227,9 +227,9 @@ async def create_entity( from google.cloud import dataplex_v1 - def sample_create_entity(): + async def sample_create_entity(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) entity = dataplex_v1.Entity() @@ -247,7 +247,7 @@ def sample_create_entity(): ) # Make the request - response = client.create_entity(request=request) + response = await client.create_entity(request=request) # Handle the response print(response) @@ -338,9 +338,9 @@ async def update_entity( from google.cloud import dataplex_v1 - def sample_update_entity(): + async def sample_update_entity(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) entity = dataplex_v1.Entity() @@ -357,7 +357,7 @@ def sample_update_entity(): ) # Make the request - response = client.update_entity(request=request) + response = await client.update_entity(request=request) # Handle the response print(response) @@ -426,9 +426,9 @@ async def delete_entity( from google.cloud import dataplex_v1 - def sample_delete_entity(): + async def sample_delete_entity(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeleteEntityRequest( @@ -437,7 +437,7 @@ def sample_delete_entity(): ) # Make the request - client.delete_entity(request=request) + await client.delete_entity(request=request) Args: request (Union[google.cloud.dataplex_v1.types.DeleteEntityRequest, dict]): @@ -509,9 +509,9 @@ async def get_entity( from google.cloud import dataplex_v1 - def sample_get_entity(): + async def sample_get_entity(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetEntityRequest( @@ -519,7 +519,7 @@ def sample_get_entity(): ) # Make the request - response = client.get_entity(request=request) + response = await client.get_entity(request=request) # Handle the response print(response) @@ -612,9 +612,9 @@ async def list_entities( from google.cloud import dataplex_v1 - def sample_list_entities(): + async def sample_list_entities(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListEntitiesRequest( @@ -626,7 +626,7 @@ def sample_list_entities(): page_result = client.list_entities(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -729,9 +729,9 @@ async def create_partition( from google.cloud import dataplex_v1 - def sample_create_partition(): + async def sample_create_partition(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) partition = dataplex_v1.Partition() @@ -744,7 +744,7 @@ def sample_create_partition(): ) # Make the request - response = client.create_partition(request=request) + response = await client.create_partition(request=request) # Handle the response print(response) @@ -835,9 +835,9 @@ async def delete_partition( from google.cloud import dataplex_v1 - def sample_delete_partition(): + async def sample_delete_partition(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.DeletePartitionRequest( @@ -845,7 +845,7 @@ def sample_delete_partition(): ) # Make the request - client.delete_partition(request=request) + await client.delete_partition(request=request) Args: request (Union[google.cloud.dataplex_v1.types.DeletePartitionRequest, dict]): @@ -920,9 +920,9 @@ async def get_partition( from google.cloud import dataplex_v1 - def sample_get_partition(): + async def sample_get_partition(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.GetPartitionRequest( @@ -930,7 +930,7 @@ def sample_get_partition(): ) # Make the request - response = client.get_partition(request=request) + response = await client.get_partition(request=request) # Handle the response print(response) @@ -1026,9 +1026,9 @@ async def list_partitions( from google.cloud import dataplex_v1 - def sample_list_partitions(): + async def sample_list_partitions(): # Create a client - client = dataplex_v1.MetadataServiceClient() + client = dataplex_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = dataplex_v1.ListPartitionsRequest( @@ -1039,7 +1039,7 @@ def sample_list_partitions(): page_result = client.list_partitions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_content_service.py b/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_content_service.py index 5e85057f12fd..be1e181bc999 100644 --- a/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_content_service.py +++ b/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_content_service.py @@ -761,7 +761,7 @@ def test_create_content_field_headers(): # a field header. Set these to a non-empty value. request = gcd_content.CreateContentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_content), "__call__") as call: @@ -777,7 +777,7 @@ def test_create_content_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -791,7 +791,7 @@ async def test_create_content_field_headers_async(): # a field header. Set these to a non-empty value. request = gcd_content.CreateContentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_content), "__call__") as call: @@ -807,7 +807,7 @@ async def test_create_content_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1015,7 +1015,7 @@ def test_update_content_field_headers(): # a field header. Set these to a non-empty value. request = gcd_content.UpdateContentRequest() - request.content.name = "content.name/value" + request.content.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_content), "__call__") as call: @@ -1031,7 +1031,7 @@ def test_update_content_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "content.name=content.name/value", + "content.name=name_value", ) in kw["metadata"] @@ -1045,7 +1045,7 @@ async def test_update_content_field_headers_async(): # a field header. Set these to a non-empty value. request = gcd_content.UpdateContentRequest() - request.content.name = "content.name/value" + request.content.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_content), "__call__") as call: @@ -1061,7 +1061,7 @@ async def test_update_content_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "content.name=content.name/value", + "content.name=name_value", ) in kw["metadata"] @@ -1245,7 +1245,7 @@ def test_delete_content_field_headers(): # a field header. Set these to a non-empty value. request = content.DeleteContentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_content), "__call__") as call: @@ -1261,7 +1261,7 @@ def test_delete_content_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1275,7 +1275,7 @@ async def test_delete_content_field_headers_async(): # a field header. Set these to a non-empty value. request = content.DeleteContentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_content), "__call__") as call: @@ -1291,7 +1291,7 @@ async def test_delete_content_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1489,7 +1489,7 @@ def test_get_content_field_headers(): # a field header. Set these to a non-empty value. request = content.GetContentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_content), "__call__") as call: @@ -1505,7 +1505,7 @@ def test_get_content_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1519,7 +1519,7 @@ async def test_get_content_field_headers_async(): # a field header. Set these to a non-empty value. request = content.GetContentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_content), "__call__") as call: @@ -1535,7 +1535,7 @@ async def test_get_content_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1717,7 +1717,7 @@ def test_list_content_field_headers(): # a field header. Set these to a non-empty value. request = content.ListContentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_content), "__call__") as call: @@ -1733,7 +1733,7 @@ def test_list_content_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1747,7 +1747,7 @@ async def test_list_content_field_headers_async(): # a field header. Set these to a non-empty value. request = content.ListContentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_content), "__call__") as call: @@ -1765,7 +1765,7 @@ async def test_list_content_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1896,7 +1896,7 @@ def test_list_content_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, analyze.Content) for i in results) diff --git a/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_dataplex_service.py b/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_dataplex_service.py index 4db7ef6dfbaf..24bb9762a6da 100644 --- a/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_dataplex_service.py +++ b/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_dataplex_service.py @@ -762,7 +762,7 @@ def test_create_lake_field_headers(): # a field header. Set these to a non-empty value. request = service.CreateLakeRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_lake), "__call__") as call: @@ -778,7 +778,7 @@ def test_create_lake_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -792,7 +792,7 @@ async def test_create_lake_field_headers_async(): # a field header. Set these to a non-empty value. request = service.CreateLakeRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_lake), "__call__") as call: @@ -810,7 +810,7 @@ async def test_create_lake_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1008,7 +1008,7 @@ def test_update_lake_field_headers(): # a field header. Set these to a non-empty value. request = service.UpdateLakeRequest() - request.lake.name = "lake.name/value" + request.lake.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_lake), "__call__") as call: @@ -1024,7 +1024,7 @@ def test_update_lake_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "lake.name=lake.name/value", + "lake.name=name_value", ) in kw["metadata"] @@ -1038,7 +1038,7 @@ async def test_update_lake_field_headers_async(): # a field header. Set these to a non-empty value. request = service.UpdateLakeRequest() - request.lake.name = "lake.name/value" + request.lake.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_lake), "__call__") as call: @@ -1056,7 +1056,7 @@ async def test_update_lake_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "lake.name=lake.name/value", + "lake.name=name_value", ) in kw["metadata"] @@ -1244,7 +1244,7 @@ def test_delete_lake_field_headers(): # a field header. Set these to a non-empty value. request = service.DeleteLakeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_lake), "__call__") as call: @@ -1260,7 +1260,7 @@ def test_delete_lake_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1274,7 +1274,7 @@ async def test_delete_lake_field_headers_async(): # a field header. Set these to a non-empty value. request = service.DeleteLakeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_lake), "__call__") as call: @@ -1292,7 +1292,7 @@ async def test_delete_lake_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1480,7 +1480,7 @@ def test_list_lakes_field_headers(): # a field header. Set these to a non-empty value. request = service.ListLakesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_lakes), "__call__") as call: @@ -1496,7 +1496,7 @@ def test_list_lakes_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1510,7 +1510,7 @@ async def test_list_lakes_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListLakesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_lakes), "__call__") as call: @@ -1528,7 +1528,7 @@ async def test_list_lakes_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1659,7 +1659,7 @@ def test_list_lakes_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, resources.Lake) for i in results) @@ -1920,7 +1920,7 @@ def test_get_lake_field_headers(): # a field header. Set these to a non-empty value. request = service.GetLakeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_lake), "__call__") as call: @@ -1936,7 +1936,7 @@ def test_get_lake_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1950,7 +1950,7 @@ async def test_get_lake_field_headers_async(): # a field header. Set these to a non-empty value. request = service.GetLakeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_lake), "__call__") as call: @@ -1966,7 +1966,7 @@ async def test_get_lake_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2154,7 +2154,7 @@ def test_list_lake_actions_field_headers(): # a field header. Set these to a non-empty value. request = service.ListLakeActionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2172,7 +2172,7 @@ def test_list_lake_actions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2186,7 +2186,7 @@ async def test_list_lake_actions_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListLakeActionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2206,7 +2206,7 @@ async def test_list_lake_actions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2343,7 +2343,7 @@ def test_list_lake_actions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, resources.Action) for i in results) @@ -2584,7 +2584,7 @@ def test_create_zone_field_headers(): # a field header. Set these to a non-empty value. request = service.CreateZoneRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_zone), "__call__") as call: @@ -2600,7 +2600,7 @@ def test_create_zone_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2614,7 +2614,7 @@ async def test_create_zone_field_headers_async(): # a field header. Set these to a non-empty value. request = service.CreateZoneRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_zone), "__call__") as call: @@ -2632,7 +2632,7 @@ async def test_create_zone_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2830,7 +2830,7 @@ def test_update_zone_field_headers(): # a field header. Set these to a non-empty value. request = service.UpdateZoneRequest() - request.zone.name = "zone.name/value" + request.zone.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_zone), "__call__") as call: @@ -2846,7 +2846,7 @@ def test_update_zone_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "zone.name=zone.name/value", + "zone.name=name_value", ) in kw["metadata"] @@ -2860,7 +2860,7 @@ async def test_update_zone_field_headers_async(): # a field header. Set these to a non-empty value. request = service.UpdateZoneRequest() - request.zone.name = "zone.name/value" + request.zone.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_zone), "__call__") as call: @@ -2878,7 +2878,7 @@ async def test_update_zone_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "zone.name=zone.name/value", + "zone.name=name_value", ) in kw["metadata"] @@ -3066,7 +3066,7 @@ def test_delete_zone_field_headers(): # a field header. Set these to a non-empty value. request = service.DeleteZoneRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_zone), "__call__") as call: @@ -3082,7 +3082,7 @@ def test_delete_zone_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3096,7 +3096,7 @@ async def test_delete_zone_field_headers_async(): # a field header. Set these to a non-empty value. request = service.DeleteZoneRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_zone), "__call__") as call: @@ -3114,7 +3114,7 @@ async def test_delete_zone_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3298,7 +3298,7 @@ def test_list_zones_field_headers(): # a field header. Set these to a non-empty value. request = service.ListZonesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_zones), "__call__") as call: @@ -3314,7 +3314,7 @@ def test_list_zones_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3328,7 +3328,7 @@ async def test_list_zones_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListZonesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_zones), "__call__") as call: @@ -3346,7 +3346,7 @@ async def test_list_zones_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3477,7 +3477,7 @@ def test_list_zones_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, resources.Zone) for i in results) @@ -3738,7 +3738,7 @@ def test_get_zone_field_headers(): # a field header. Set these to a non-empty value. request = service.GetZoneRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_zone), "__call__") as call: @@ -3754,7 +3754,7 @@ def test_get_zone_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3768,7 +3768,7 @@ async def test_get_zone_field_headers_async(): # a field header. Set these to a non-empty value. request = service.GetZoneRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_zone), "__call__") as call: @@ -3784,7 +3784,7 @@ async def test_get_zone_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3972,7 +3972,7 @@ def test_list_zone_actions_field_headers(): # a field header. Set these to a non-empty value. request = service.ListZoneActionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3990,7 +3990,7 @@ def test_list_zone_actions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4004,7 +4004,7 @@ async def test_list_zone_actions_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListZoneActionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4024,7 +4024,7 @@ async def test_list_zone_actions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4161,7 +4161,7 @@ def test_list_zone_actions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, resources.Action) for i in results) @@ -4402,7 +4402,7 @@ def test_create_asset_field_headers(): # a field header. Set these to a non-empty value. request = service.CreateAssetRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_asset), "__call__") as call: @@ -4418,7 +4418,7 @@ def test_create_asset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4432,7 +4432,7 @@ async def test_create_asset_field_headers_async(): # a field header. Set these to a non-empty value. request = service.CreateAssetRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_asset), "__call__") as call: @@ -4450,7 +4450,7 @@ async def test_create_asset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4648,7 +4648,7 @@ def test_update_asset_field_headers(): # a field header. Set these to a non-empty value. request = service.UpdateAssetRequest() - request.asset.name = "asset.name/value" + request.asset.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_asset), "__call__") as call: @@ -4664,7 +4664,7 @@ def test_update_asset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "asset.name=asset.name/value", + "asset.name=name_value", ) in kw["metadata"] @@ -4678,7 +4678,7 @@ async def test_update_asset_field_headers_async(): # a field header. Set these to a non-empty value. request = service.UpdateAssetRequest() - request.asset.name = "asset.name/value" + request.asset.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_asset), "__call__") as call: @@ -4696,7 +4696,7 @@ async def test_update_asset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "asset.name=asset.name/value", + "asset.name=name_value", ) in kw["metadata"] @@ -4884,7 +4884,7 @@ def test_delete_asset_field_headers(): # a field header. Set these to a non-empty value. request = service.DeleteAssetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_asset), "__call__") as call: @@ -4900,7 +4900,7 @@ def test_delete_asset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4914,7 +4914,7 @@ async def test_delete_asset_field_headers_async(): # a field header. Set these to a non-empty value. request = service.DeleteAssetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_asset), "__call__") as call: @@ -4932,7 +4932,7 @@ async def test_delete_asset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5116,7 +5116,7 @@ def test_list_assets_field_headers(): # a field header. Set these to a non-empty value. request = service.ListAssetsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_assets), "__call__") as call: @@ -5132,7 +5132,7 @@ def test_list_assets_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5146,7 +5146,7 @@ async def test_list_assets_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListAssetsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_assets), "__call__") as call: @@ -5164,7 +5164,7 @@ async def test_list_assets_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5295,7 +5295,7 @@ def test_list_assets_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, resources.Asset) for i in results) @@ -5552,7 +5552,7 @@ def test_get_asset_field_headers(): # a field header. Set these to a non-empty value. request = service.GetAssetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_asset), "__call__") as call: @@ -5568,7 +5568,7 @@ def test_get_asset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5582,7 +5582,7 @@ async def test_get_asset_field_headers_async(): # a field header. Set these to a non-empty value. request = service.GetAssetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_asset), "__call__") as call: @@ -5598,7 +5598,7 @@ async def test_get_asset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5786,7 +5786,7 @@ def test_list_asset_actions_field_headers(): # a field header. Set these to a non-empty value. request = service.ListAssetActionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5804,7 +5804,7 @@ def test_list_asset_actions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5818,7 +5818,7 @@ async def test_list_asset_actions_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListAssetActionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5838,7 +5838,7 @@ async def test_list_asset_actions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5975,7 +5975,7 @@ def test_list_asset_actions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, resources.Action) for i in results) @@ -6216,7 +6216,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = service.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -6232,7 +6232,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6246,7 +6246,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = service.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -6264,7 +6264,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6462,7 +6462,7 @@ def test_update_task_field_headers(): # a field header. Set these to a non-empty value. request = service.UpdateTaskRequest() - request.task.name = "task.name/value" + request.task.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_task), "__call__") as call: @@ -6478,7 +6478,7 @@ def test_update_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "task.name=task.name/value", + "task.name=name_value", ) in kw["metadata"] @@ -6492,7 +6492,7 @@ async def test_update_task_field_headers_async(): # a field header. Set these to a non-empty value. request = service.UpdateTaskRequest() - request.task.name = "task.name/value" + request.task.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_task), "__call__") as call: @@ -6510,7 +6510,7 @@ async def test_update_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "task.name=task.name/value", + "task.name=name_value", ) in kw["metadata"] @@ -6698,7 +6698,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = service.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -6714,7 +6714,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6728,7 +6728,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = service.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -6746,7 +6746,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6934,7 +6934,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = service.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -6950,7 +6950,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6964,7 +6964,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -6982,7 +6982,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7113,7 +7113,7 @@ def test_list_tasks_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tasks.Task) for i in results) @@ -7373,7 +7373,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = service.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -7389,7 +7389,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7403,7 +7403,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = service.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -7419,7 +7419,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7601,7 +7601,7 @@ def test_list_jobs_field_headers(): # a field header. Set these to a non-empty value. request = service.ListJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -7617,7 +7617,7 @@ def test_list_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7631,7 +7631,7 @@ async def test_list_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -7649,7 +7649,7 @@ async def test_list_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7780,7 +7780,7 @@ def test_list_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tasks.Job) for i in results) @@ -8045,7 +8045,7 @@ def test_get_job_field_headers(): # a field header. Set these to a non-empty value. request = service.GetJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -8061,7 +8061,7 @@ def test_get_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8075,7 +8075,7 @@ async def test_get_job_field_headers_async(): # a field header. Set these to a non-empty value. request = service.GetJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -8091,7 +8091,7 @@ async def test_get_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8265,7 +8265,7 @@ def test_cancel_job_field_headers(): # a field header. Set these to a non-empty value. request = service.CancelJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_job), "__call__") as call: @@ -8281,7 +8281,7 @@ def test_cancel_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8295,7 +8295,7 @@ async def test_cancel_job_field_headers_async(): # a field header. Set these to a non-empty value. request = service.CancelJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_job), "__call__") as call: @@ -8311,7 +8311,7 @@ async def test_cancel_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8493,7 +8493,7 @@ def test_create_environment_field_headers(): # a field header. Set these to a non-empty value. request = service.CreateEnvironmentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8511,7 +8511,7 @@ def test_create_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8525,7 +8525,7 @@ async def test_create_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = service.CreateEnvironmentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8545,7 +8545,7 @@ async def test_create_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8753,7 +8753,7 @@ def test_update_environment_field_headers(): # a field header. Set these to a non-empty value. request = service.UpdateEnvironmentRequest() - request.environment.name = "environment.name/value" + request.environment.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8771,7 +8771,7 @@ def test_update_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "environment.name=environment.name/value", + "environment.name=name_value", ) in kw["metadata"] @@ -8785,7 +8785,7 @@ async def test_update_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = service.UpdateEnvironmentRequest() - request.environment.name = "environment.name/value" + request.environment.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8805,7 +8805,7 @@ async def test_update_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "environment.name=environment.name/value", + "environment.name=name_value", ) in kw["metadata"] @@ -9003,7 +9003,7 @@ def test_delete_environment_field_headers(): # a field header. Set these to a non-empty value. request = service.DeleteEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9021,7 +9021,7 @@ def test_delete_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -9035,7 +9035,7 @@ async def test_delete_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = service.DeleteEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9055,7 +9055,7 @@ async def test_delete_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -9249,7 +9249,7 @@ def test_list_environments_field_headers(): # a field header. Set these to a non-empty value. request = service.ListEnvironmentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9267,7 +9267,7 @@ def test_list_environments_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -9281,7 +9281,7 @@ async def test_list_environments_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListEnvironmentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9301,7 +9301,7 @@ async def test_list_environments_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -9438,7 +9438,7 @@ def test_list_environments_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, analyze.Environment) for i in results) @@ -9701,7 +9701,7 @@ def test_get_environment_field_headers(): # a field header. Set these to a non-empty value. request = service.GetEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_environment), "__call__") as call: @@ -9717,7 +9717,7 @@ def test_get_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -9731,7 +9731,7 @@ async def test_get_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = service.GetEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_environment), "__call__") as call: @@ -9747,7 +9747,7 @@ async def test_get_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -9929,7 +9929,7 @@ def test_list_sessions_field_headers(): # a field header. Set these to a non-empty value. request = service.ListSessionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_sessions), "__call__") as call: @@ -9945,7 +9945,7 @@ def test_list_sessions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -9959,7 +9959,7 @@ async def test_list_sessions_field_headers_async(): # a field header. Set these to a non-empty value. request = service.ListSessionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_sessions), "__call__") as call: @@ -9977,7 +9977,7 @@ async def test_list_sessions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -10108,7 +10108,7 @@ def test_list_sessions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, analyze.Session) for i in results) diff --git a/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_metadata_service.py b/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_metadata_service.py index ab7ced8096c6..debcd89b0e84 100644 --- a/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_metadata_service.py +++ b/packages/google-cloud-dataplex/tests/unit/gapic/dataplex_v1/test_metadata_service.py @@ -796,7 +796,7 @@ def test_create_entity_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.CreateEntityRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_entity), "__call__") as call: @@ -812,7 +812,7 @@ def test_create_entity_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -826,7 +826,7 @@ async def test_create_entity_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.CreateEntityRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_entity), "__call__") as call: @@ -842,7 +842,7 @@ async def test_create_entity_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1074,7 +1074,7 @@ def test_update_entity_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.UpdateEntityRequest() - request.entity.name = "entity.name/value" + request.entity.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_entity), "__call__") as call: @@ -1090,7 +1090,7 @@ def test_update_entity_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity.name=entity.name/value", + "entity.name=name_value", ) in kw["metadata"] @@ -1104,7 +1104,7 @@ async def test_update_entity_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.UpdateEntityRequest() - request.entity.name = "entity.name/value" + request.entity.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_entity), "__call__") as call: @@ -1120,7 +1120,7 @@ async def test_update_entity_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity.name=entity.name/value", + "entity.name=name_value", ) in kw["metadata"] @@ -1214,7 +1214,7 @@ def test_delete_entity_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.DeleteEntityRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_entity), "__call__") as call: @@ -1230,7 +1230,7 @@ def test_delete_entity_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1244,7 +1244,7 @@ async def test_delete_entity_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.DeleteEntityRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_entity), "__call__") as call: @@ -1260,7 +1260,7 @@ async def test_delete_entity_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1482,7 +1482,7 @@ def test_get_entity_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.GetEntityRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entity), "__call__") as call: @@ -1498,7 +1498,7 @@ def test_get_entity_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1512,7 +1512,7 @@ async def test_get_entity_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.GetEntityRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entity), "__call__") as call: @@ -1528,7 +1528,7 @@ async def test_get_entity_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1710,7 +1710,7 @@ def test_list_entities_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.ListEntitiesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_entities), "__call__") as call: @@ -1726,7 +1726,7 @@ def test_list_entities_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1740,7 +1740,7 @@ async def test_list_entities_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.ListEntitiesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_entities), "__call__") as call: @@ -1758,7 +1758,7 @@ async def test_list_entities_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1889,7 +1889,7 @@ def test_list_entities_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, metadata_.Entity) for i in results) @@ -2142,7 +2142,7 @@ def test_create_partition_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.CreatePartitionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_partition), "__call__") as call: @@ -2158,7 +2158,7 @@ def test_create_partition_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2172,7 +2172,7 @@ async def test_create_partition_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.CreatePartitionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_partition), "__call__") as call: @@ -2188,7 +2188,7 @@ async def test_create_partition_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2372,7 +2372,7 @@ def test_delete_partition_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.DeletePartitionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_partition), "__call__") as call: @@ -2388,7 +2388,7 @@ def test_delete_partition_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2402,7 +2402,7 @@ async def test_delete_partition_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.DeletePartitionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_partition), "__call__") as call: @@ -2418,7 +2418,7 @@ async def test_delete_partition_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2612,7 +2612,7 @@ def test_get_partition_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.GetPartitionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_partition), "__call__") as call: @@ -2628,7 +2628,7 @@ def test_get_partition_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2642,7 +2642,7 @@ async def test_get_partition_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.GetPartitionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_partition), "__call__") as call: @@ -2658,7 +2658,7 @@ async def test_get_partition_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2840,7 +2840,7 @@ def test_list_partitions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_.ListPartitionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_partitions), "__call__") as call: @@ -2856,7 +2856,7 @@ def test_list_partitions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2870,7 +2870,7 @@ async def test_list_partitions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_.ListPartitionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_partitions), "__call__") as call: @@ -2888,7 +2888,7 @@ async def test_list_partitions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3019,7 +3019,7 @@ def test_list_partitions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, metadata_.Partition) for i in results)