From 4c596a3b6e158562c2c6b68b79bfdf49425928b9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 09:42:17 -0400 Subject: [PATCH 1/8] chore: use gapic-generator-python 0.65.2 (#159) 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 --- .../artifact_registry/async_client.py | 162 ++++++------- .../artifact_registry/async_client.py | 150 ++++++------ .../test_artifact_registry.py | 228 +++++++++--------- .../test_artifact_registry.py | 210 ++++++++-------- 4 files changed, 375 insertions(+), 375 deletions(-) diff --git a/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py b/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py index fb2d22b..a76abd2 100644 --- a/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py +++ b/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py @@ -268,9 +268,9 @@ async def list_docker_images( from google.cloud import artifactregistry_v1 - def sample_list_docker_images(): + async def sample_list_docker_images(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ListDockerImagesRequest( @@ -281,7 +281,7 @@ def sample_list_docker_images(): page_result = client.list_docker_images(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -376,9 +376,9 @@ async def get_docker_image( from google.cloud import artifactregistry_v1 - def sample_get_docker_image(): + async def sample_get_docker_image(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetDockerImageRequest( @@ -386,7 +386,7 @@ def sample_get_docker_image(): ) # Make the request - response = client.get_docker_image(request=request) + response = await client.get_docker_image(request=request) # Handle the response print(response) @@ -476,9 +476,9 @@ async def import_apt_artifacts( from google.cloud import artifactregistry_v1 - def sample_import_apt_artifacts(): + async def sample_import_apt_artifacts(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ImportAptArtifactsRequest( @@ -489,7 +489,7 @@ def sample_import_apt_artifacts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -567,9 +567,9 @@ async def import_yum_artifacts( from google.cloud import artifactregistry_v1 - def sample_import_yum_artifacts(): + async def sample_import_yum_artifacts(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ImportYumArtifactsRequest( @@ -580,7 +580,7 @@ def sample_import_yum_artifacts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -655,9 +655,9 @@ async def list_repositories( from google.cloud import artifactregistry_v1 - def sample_list_repositories(): + async def sample_list_repositories(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ListRepositoriesRequest( @@ -668,7 +668,7 @@ def sample_list_repositories(): page_result = client.list_repositories(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -763,9 +763,9 @@ async def get_repository( from google.cloud import artifactregistry_v1 - def sample_get_repository(): + async def sample_get_repository(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetRepositoryRequest( @@ -773,7 +773,7 @@ def sample_get_repository(): ) # Make the request - response = client.get_repository(request=request) + response = await client.get_repository(request=request) # Handle the response print(response) @@ -862,9 +862,9 @@ async def create_repository( from google.cloud import artifactregistry_v1 - def sample_create_repository(): + async def sample_create_repository(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.CreateRepositoryRequest( @@ -876,7 +876,7 @@ def sample_create_repository(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -991,16 +991,16 @@ async def update_repository( from google.cloud import artifactregistry_v1 - def sample_update_repository(): + async def sample_update_repository(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.UpdateRepositoryRequest( ) # Make the request - response = client.update_repository(request=request) + response = await client.update_repository(request=request) # Handle the response print(response) @@ -1099,9 +1099,9 @@ async def delete_repository( from google.cloud import artifactregistry_v1 - def sample_delete_repository(): + async def sample_delete_repository(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.DeleteRepositoryRequest( @@ -1113,7 +1113,7 @@ def sample_delete_repository(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1218,9 +1218,9 @@ async def list_packages( from google.cloud import artifactregistry_v1 - def sample_list_packages(): + async def sample_list_packages(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ListPackagesRequest( @@ -1231,7 +1231,7 @@ def sample_list_packages(): page_result = client.list_packages(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1324,9 +1324,9 @@ async def get_package( from google.cloud import artifactregistry_v1 - def sample_get_package(): + async def sample_get_package(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetPackageRequest( @@ -1334,7 +1334,7 @@ def sample_get_package(): ) # Make the request - response = client.get_package(request=request) + response = await client.get_package(request=request) # Handle the response print(response) @@ -1420,9 +1420,9 @@ async def delete_package( from google.cloud import artifactregistry_v1 - def sample_delete_package(): + async def sample_delete_package(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.DeletePackageRequest( @@ -1434,7 +1434,7 @@ def sample_delete_package(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1539,9 +1539,9 @@ async def list_versions( from google.cloud import artifactregistry_v1 - def sample_list_versions(): + async def sample_list_versions(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ListVersionsRequest( @@ -1551,7 +1551,7 @@ def sample_list_versions(): page_result = client.list_versions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1644,16 +1644,16 @@ async def get_version( from google.cloud import artifactregistry_v1 - def sample_get_version(): + async def sample_get_version(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetVersionRequest( ) # Make the request - response = client.get_version(request=request) + response = await client.get_version(request=request) # Handle the response print(response) @@ -1740,9 +1740,9 @@ async def delete_version( from google.cloud import artifactregistry_v1 - def sample_delete_version(): + async def sample_delete_version(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.DeleteVersionRequest( @@ -1753,7 +1753,7 @@ def sample_delete_version(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1856,9 +1856,9 @@ async def list_files( from google.cloud import artifactregistry_v1 - def sample_list_files(): + async def sample_list_files(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ListFilesRequest( @@ -1868,7 +1868,7 @@ def sample_list_files(): page_result = client.list_files(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1962,16 +1962,16 @@ async def get_file( from google.cloud import artifactregistry_v1 - def sample_get_file(): + async def sample_get_file(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetFileRequest( ) # Make the request - response = client.get_file(request=request) + response = await client.get_file(request=request) # Handle the response print(response) @@ -2054,9 +2054,9 @@ async def list_tags( from google.cloud import artifactregistry_v1 - def sample_list_tags(): + async def sample_list_tags(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.ListTagsRequest( @@ -2066,7 +2066,7 @@ def sample_list_tags(): page_result = client.list_tags(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2159,16 +2159,16 @@ async def get_tag( from google.cloud import artifactregistry_v1 - def sample_get_tag(): + async def sample_get_tag(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetTagRequest( ) # Make the request - response = client.get_tag(request=request) + response = await client.get_tag(request=request) # Handle the response print(response) @@ -2253,16 +2253,16 @@ async def create_tag( from google.cloud import artifactregistry_v1 - def sample_create_tag(): + async def sample_create_tag(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.CreateTagRequest( ) # Make the request - response = client.create_tag(request=request) + response = await client.create_tag(request=request) # Handle the response print(response) @@ -2364,16 +2364,16 @@ async def update_tag( from google.cloud import artifactregistry_v1 - def sample_update_tag(): + async def sample_update_tag(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.UpdateTagRequest( ) # Make the request - response = client.update_tag(request=request) + response = await client.update_tag(request=request) # Handle the response print(response) @@ -2469,16 +2469,16 @@ async def delete_tag( from google.cloud import artifactregistry_v1 - def sample_delete_tag(): + async def sample_delete_tag(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.DeleteTagRequest( ) # Make the request - client.delete_tag(request=request) + await client.delete_tag(request=request) Args: request (Union[google.cloud.artifactregistry_v1.types.DeleteTagRequest, dict]): @@ -2548,9 +2548,9 @@ async def set_iam_policy( from google.cloud import artifactregistry_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -2558,7 +2558,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -2684,9 +2684,9 @@ async def get_iam_policy( from google.cloud import artifactregistry_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -2694,7 +2694,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -2821,9 +2821,9 @@ async def test_iam_permissions( from google.cloud import artifactregistry_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -2832,7 +2832,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) @@ -2897,9 +2897,9 @@ async def get_project_settings( from google.cloud import artifactregistry_v1 - def sample_get_project_settings(): + async def sample_get_project_settings(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.GetProjectSettingsRequest( @@ -2907,7 +2907,7 @@ def sample_get_project_settings(): ) # Make the request - response = client.get_project_settings(request=request) + response = await client.get_project_settings(request=request) # Handle the response print(response) @@ -2993,16 +2993,16 @@ async def update_project_settings( from google.cloud import artifactregistry_v1 - def sample_update_project_settings(): + async def sample_update_project_settings(): # Create a client - client = artifactregistry_v1.ArtifactRegistryClient() + client = artifactregistry_v1.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1.UpdateProjectSettingsRequest( ) # Make the request - response = client.update_project_settings(request=request) + response = await client.update_project_settings(request=request) # Handle the response print(response) diff --git a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py index 89ea79e..878da9d 100644 --- a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py +++ b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py @@ -267,9 +267,9 @@ async def import_apt_artifacts( from google.cloud import artifactregistry_v1beta2 - def sample_import_apt_artifacts(): + async def sample_import_apt_artifacts(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ImportAptArtifactsRequest( @@ -280,7 +280,7 @@ def sample_import_apt_artifacts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -358,9 +358,9 @@ async def import_yum_artifacts( from google.cloud import artifactregistry_v1beta2 - def sample_import_yum_artifacts(): + async def sample_import_yum_artifacts(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ImportYumArtifactsRequest( @@ -371,7 +371,7 @@ def sample_import_yum_artifacts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -446,9 +446,9 @@ async def list_repositories( from google.cloud import artifactregistry_v1beta2 - def sample_list_repositories(): + async def sample_list_repositories(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ListRepositoriesRequest( @@ -459,7 +459,7 @@ def sample_list_repositories(): page_result = client.list_repositories(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -563,9 +563,9 @@ async def get_repository( from google.cloud import artifactregistry_v1beta2 - def sample_get_repository(): + async def sample_get_repository(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.GetRepositoryRequest( @@ -573,7 +573,7 @@ def sample_get_repository(): ) # Make the request - response = client.get_repository(request=request) + response = await client.get_repository(request=request) # Handle the response print(response) @@ -671,9 +671,9 @@ async def create_repository( from google.cloud import artifactregistry_v1beta2 - def sample_create_repository(): + async def sample_create_repository(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.CreateRepositoryRequest( @@ -685,7 +685,7 @@ def sample_create_repository(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -800,16 +800,16 @@ async def update_repository( from google.cloud import artifactregistry_v1beta2 - def sample_update_repository(): + async def sample_update_repository(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.UpdateRepositoryRequest( ) # Make the request - response = client.update_repository(request=request) + response = await client.update_repository(request=request) # Handle the response print(response) @@ -908,9 +908,9 @@ async def delete_repository( from google.cloud import artifactregistry_v1beta2 - def sample_delete_repository(): + async def sample_delete_repository(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.DeleteRepositoryRequest( @@ -922,7 +922,7 @@ def sample_delete_repository(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1036,9 +1036,9 @@ async def list_packages( from google.cloud import artifactregistry_v1beta2 - def sample_list_packages(): + async def sample_list_packages(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ListPackagesRequest( @@ -1048,7 +1048,7 @@ def sample_list_packages(): page_result = client.list_packages(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1150,16 +1150,16 @@ async def get_package( from google.cloud import artifactregistry_v1beta2 - def sample_get_package(): + async def sample_get_package(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.GetPackageRequest( ) # Make the request - response = client.get_package(request=request) + response = await client.get_package(request=request) # Handle the response print(response) @@ -1252,9 +1252,9 @@ async def delete_package( from google.cloud import artifactregistry_v1beta2 - def sample_delete_package(): + async def sample_delete_package(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.DeletePackageRequest( @@ -1265,7 +1265,7 @@ def sample_delete_package(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1377,9 +1377,9 @@ async def list_versions( from google.cloud import artifactregistry_v1beta2 - def sample_list_versions(): + async def sample_list_versions(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ListVersionsRequest( @@ -1389,7 +1389,7 @@ def sample_list_versions(): page_result = client.list_versions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1491,16 +1491,16 @@ async def get_version( from google.cloud import artifactregistry_v1beta2 - def sample_get_version(): + async def sample_get_version(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.GetVersionRequest( ) # Make the request - response = client.get_version(request=request) + response = await client.get_version(request=request) # Handle the response print(response) @@ -1596,9 +1596,9 @@ async def delete_version( from google.cloud import artifactregistry_v1beta2 - def sample_delete_version(): + async def sample_delete_version(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.DeleteVersionRequest( @@ -1609,7 +1609,7 @@ def sample_delete_version(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1721,9 +1721,9 @@ async def list_files( from google.cloud import artifactregistry_v1beta2 - def sample_list_files(): + async def sample_list_files(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ListFilesRequest( @@ -1733,7 +1733,7 @@ def sample_list_files(): page_result = client.list_files(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1836,16 +1836,16 @@ async def get_file( from google.cloud import artifactregistry_v1beta2 - def sample_get_file(): + async def sample_get_file(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.GetFileRequest( ) # Make the request - response = client.get_file(request=request) + response = await client.get_file(request=request) # Handle the response print(response) @@ -1937,9 +1937,9 @@ async def list_tags( from google.cloud import artifactregistry_v1beta2 - def sample_list_tags(): + async def sample_list_tags(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.ListTagsRequest( @@ -1949,7 +1949,7 @@ def sample_list_tags(): page_result = client.list_tags(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2051,16 +2051,16 @@ async def get_tag( from google.cloud import artifactregistry_v1beta2 - def sample_get_tag(): + async def sample_get_tag(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.GetTagRequest( ) # Make the request - response = client.get_tag(request=request) + response = await client.get_tag(request=request) # Handle the response print(response) @@ -2154,16 +2154,16 @@ async def create_tag( from google.cloud import artifactregistry_v1beta2 - def sample_create_tag(): + async def sample_create_tag(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.CreateTagRequest( ) # Make the request - response = client.create_tag(request=request) + response = await client.create_tag(request=request) # Handle the response print(response) @@ -2265,16 +2265,16 @@ async def update_tag( from google.cloud import artifactregistry_v1beta2 - def sample_update_tag(): + async def sample_update_tag(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.UpdateTagRequest( ) # Make the request - response = client.update_tag(request=request) + response = await client.update_tag(request=request) # Handle the response print(response) @@ -2370,16 +2370,16 @@ async def delete_tag( from google.cloud import artifactregistry_v1beta2 - def sample_delete_tag(): + async def sample_delete_tag(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.DeleteTagRequest( ) # Make the request - client.delete_tag(request=request) + await client.delete_tag(request=request) Args: request (Union[google.cloud.artifactregistry_v1beta2.types.DeleteTagRequest, dict]): @@ -2458,9 +2458,9 @@ async def set_iam_policy( from google.cloud import artifactregistry_v1beta2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -2468,7 +2468,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -2594,9 +2594,9 @@ async def get_iam_policy( from google.cloud import artifactregistry_v1beta2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -2604,7 +2604,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -2740,9 +2740,9 @@ async def test_iam_permissions( from google.cloud import artifactregistry_v1beta2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -2751,7 +2751,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) @@ -2816,9 +2816,9 @@ async def get_project_settings( from google.cloud import artifactregistry_v1beta2 - def sample_get_project_settings(): + async def sample_get_project_settings(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.GetProjectSettingsRequest( @@ -2826,7 +2826,7 @@ def sample_get_project_settings(): ) # Make the request - response = client.get_project_settings(request=request) + response = await client.get_project_settings(request=request) # Handle the response print(response) @@ -2912,16 +2912,16 @@ async def update_project_settings( from google.cloud import artifactregistry_v1beta2 - def sample_update_project_settings(): + async def sample_update_project_settings(): # Create a client - client = artifactregistry_v1beta2.ArtifactRegistryClient() + client = artifactregistry_v1beta2.ArtifactRegistryAsyncClient() # Initialize request argument(s) request = artifactregistry_v1beta2.UpdateProjectSettingsRequest( ) # Make the request - response = client.update_project_settings(request=request) + response = await client.update_project_settings(request=request) # Handle the response print(response) diff --git a/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py b/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py index de16a2a..9e558e3 100644 --- a/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py +++ b/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py @@ -788,7 +788,7 @@ def test_list_docker_images_field_headers(): # a field header. Set these to a non-empty value. request = artifact.ListDockerImagesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -806,7 +806,7 @@ def test_list_docker_images_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -820,7 +820,7 @@ async def test_list_docker_images_field_headers_async(): # a field header. Set these to a non-empty value. request = artifact.ListDockerImagesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -840,7 +840,7 @@ async def test_list_docker_images_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -977,7 +977,7 @@ def test_list_docker_images_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, artifact.DockerImage) for i in results) @@ -1240,7 +1240,7 @@ def test_get_docker_image_field_headers(): # a field header. Set these to a non-empty value. request = artifact.GetDockerImageRequest() - 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_docker_image), "__call__") as call: @@ -1256,7 +1256,7 @@ def test_get_docker_image_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1270,7 +1270,7 @@ async def test_get_docker_image_field_headers_async(): # a field header. Set these to a non-empty value. request = artifact.GetDockerImageRequest() - 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_docker_image), "__call__") as call: @@ -1288,7 +1288,7 @@ async def test_get_docker_image_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1472,7 +1472,7 @@ def test_import_apt_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = apt_artifact.ImportAptArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1490,7 +1490,7 @@ def test_import_apt_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1504,7 +1504,7 @@ async def test_import_apt_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = apt_artifact.ImportAptArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1524,7 +1524,7 @@ async def test_import_apt_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1626,7 +1626,7 @@ def test_import_yum_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = yum_artifact.ImportYumArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1644,7 +1644,7 @@ def test_import_yum_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1658,7 +1658,7 @@ async def test_import_yum_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = yum_artifact.ImportYumArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1678,7 +1678,7 @@ async def test_import_yum_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1786,7 +1786,7 @@ def test_list_repositories_field_headers(): # a field header. Set these to a non-empty value. request = repository.ListRepositoriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1804,7 +1804,7 @@ def test_list_repositories_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1818,7 +1818,7 @@ async def test_list_repositories_field_headers_async(): # a field header. Set these to a non-empty value. request = repository.ListRepositoriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1838,7 +1838,7 @@ async def test_list_repositories_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1975,7 +1975,7 @@ def test_list_repositories_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, repository.Repository) for i in results) @@ -2237,7 +2237,7 @@ def test_get_repository_field_headers(): # a field header. Set these to a non-empty value. request = repository.GetRepositoryRequest() - 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_repository), "__call__") as call: @@ -2253,7 +2253,7 @@ def test_get_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2267,7 +2267,7 @@ async def test_get_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = repository.GetRepositoryRequest() - 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_repository), "__call__") as call: @@ -2285,7 +2285,7 @@ async def test_get_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2469,7 +2469,7 @@ def test_create_repository_field_headers(): # a field header. Set these to a non-empty value. request = gda_repository.CreateRepositoryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2487,7 +2487,7 @@ def test_create_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2501,7 +2501,7 @@ async def test_create_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_repository.CreateRepositoryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2521,7 +2521,7 @@ async def test_create_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2774,7 +2774,7 @@ def test_update_repository_field_headers(): # a field header. Set these to a non-empty value. request = gda_repository.UpdateRepositoryRequest() - request.repository.name = "repository.name/value" + request.repository.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2792,7 +2792,7 @@ def test_update_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "repository.name=repository.name/value", + "repository.name=name_value", ) in kw["metadata"] @@ -2806,7 +2806,7 @@ async def test_update_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_repository.UpdateRepositoryRequest() - request.repository.name = "repository.name/value" + request.repository.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2826,7 +2826,7 @@ async def test_update_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "repository.name=repository.name/value", + "repository.name=name_value", ) in kw["metadata"] @@ -3048,7 +3048,7 @@ def test_delete_repository_field_headers(): # a field header. Set these to a non-empty value. request = repository.DeleteRepositoryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3066,7 +3066,7 @@ def test_delete_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3080,7 +3080,7 @@ async def test_delete_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = repository.DeleteRepositoryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3100,7 +3100,7 @@ async def test_delete_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3288,7 +3288,7 @@ def test_list_packages_field_headers(): # a field header. Set these to a non-empty value. request = package.ListPackagesRequest() - 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_packages), "__call__") as call: @@ -3304,7 +3304,7 @@ def test_list_packages_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3318,7 +3318,7 @@ async def test_list_packages_field_headers_async(): # a field header. Set these to a non-empty value. request = package.ListPackagesRequest() - 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_packages), "__call__") as call: @@ -3336,7 +3336,7 @@ async def test_list_packages_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3467,7 +3467,7 @@ def test_list_packages_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, package.Package) for i in results) @@ -3712,7 +3712,7 @@ def test_get_package_field_headers(): # a field header. Set these to a non-empty value. request = package.GetPackageRequest() - 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_package), "__call__") as call: @@ -3728,7 +3728,7 @@ def test_get_package_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3742,7 +3742,7 @@ async def test_get_package_field_headers_async(): # a field header. Set these to a non-empty value. request = package.GetPackageRequest() - 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_package), "__call__") as call: @@ -3758,7 +3758,7 @@ async def test_get_package_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3934,7 +3934,7 @@ def test_delete_package_field_headers(): # a field header. Set these to a non-empty value. request = package.DeletePackageRequest() - 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_package), "__call__") as call: @@ -3950,7 +3950,7 @@ def test_delete_package_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3964,7 +3964,7 @@ async def test_delete_package_field_headers_async(): # a field header. Set these to a non-empty value. request = package.DeletePackageRequest() - 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_package), "__call__") as call: @@ -3982,7 +3982,7 @@ async def test_delete_package_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4166,7 +4166,7 @@ def test_list_versions_field_headers(): # a field header. Set these to a non-empty value. request = version.ListVersionsRequest() - 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_versions), "__call__") as call: @@ -4182,7 +4182,7 @@ def test_list_versions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4196,7 +4196,7 @@ async def test_list_versions_field_headers_async(): # a field header. Set these to a non-empty value. request = version.ListVersionsRequest() - 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_versions), "__call__") as call: @@ -4214,7 +4214,7 @@ async def test_list_versions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4345,7 +4345,7 @@ def test_list_versions_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, version.Version) for i in results) @@ -4590,7 +4590,7 @@ def test_get_version_field_headers(): # a field header. Set these to a non-empty value. request = version.GetVersionRequest() - 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_version), "__call__") as call: @@ -4606,7 +4606,7 @@ def test_get_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4620,7 +4620,7 @@ async def test_get_version_field_headers_async(): # a field header. Set these to a non-empty value. request = version.GetVersionRequest() - 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_version), "__call__") as call: @@ -4636,7 +4636,7 @@ async def test_get_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4812,7 +4812,7 @@ def test_delete_version_field_headers(): # a field header. Set these to a non-empty value. request = version.DeleteVersionRequest() - 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_version), "__call__") as call: @@ -4828,7 +4828,7 @@ def test_delete_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4842,7 +4842,7 @@ async def test_delete_version_field_headers_async(): # a field header. Set these to a non-empty value. request = version.DeleteVersionRequest() - 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_version), "__call__") as call: @@ -4860,7 +4860,7 @@ async def test_delete_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5044,7 +5044,7 @@ def test_list_files_field_headers(): # a field header. Set these to a non-empty value. request = file.ListFilesRequest() - 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_files), "__call__") as call: @@ -5060,7 +5060,7 @@ def test_list_files_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5074,7 +5074,7 @@ async def test_list_files_field_headers_async(): # a field header. Set these to a non-empty value. request = file.ListFilesRequest() - 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_files), "__call__") as call: @@ -5092,7 +5092,7 @@ async def test_list_files_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5223,7 +5223,7 @@ def test_list_files_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, file.File) for i in results) @@ -5472,7 +5472,7 @@ def test_get_file_field_headers(): # a field header. Set these to a non-empty value. request = file.GetFileRequest() - 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_file), "__call__") as call: @@ -5488,7 +5488,7 @@ def test_get_file_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5502,7 +5502,7 @@ async def test_get_file_field_headers_async(): # a field header. Set these to a non-empty value. request = file.GetFileRequest() - 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_file), "__call__") as call: @@ -5518,7 +5518,7 @@ async def test_get_file_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5700,7 +5700,7 @@ def test_list_tags_field_headers(): # a field header. Set these to a non-empty value. request = tag.ListTagsRequest() - 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_tags), "__call__") as call: @@ -5716,7 +5716,7 @@ def test_list_tags_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5730,7 +5730,7 @@ async def test_list_tags_field_headers_async(): # a field header. Set these to a non-empty value. request = tag.ListTagsRequest() - 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_tags), "__call__") as call: @@ -5748,7 +5748,7 @@ async def test_list_tags_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5879,7 +5879,7 @@ def test_list_tags_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, tag.Tag) for i in results) @@ -6124,7 +6124,7 @@ def test_get_tag_field_headers(): # a field header. Set these to a non-empty value. request = tag.GetTagRequest() - 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_tag), "__call__") as call: @@ -6140,7 +6140,7 @@ def test_get_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6154,7 +6154,7 @@ async def test_get_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = tag.GetTagRequest() - 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_tag), "__call__") as call: @@ -6170,7 +6170,7 @@ async def test_get_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6356,7 +6356,7 @@ def test_create_tag_field_headers(): # a field header. Set these to a non-empty value. request = gda_tag.CreateTagRequest() - 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_tag), "__call__") as call: @@ -6372,7 +6372,7 @@ def test_create_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6386,7 +6386,7 @@ async def test_create_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_tag.CreateTagRequest() - 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_tag), "__call__") as call: @@ -6402,7 +6402,7 @@ async def test_create_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6608,7 +6608,7 @@ def test_update_tag_field_headers(): # a field header. Set these to a non-empty value. request = gda_tag.UpdateTagRequest() - request.tag.name = "tag.name/value" + request.tag.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tag), "__call__") as call: @@ -6624,7 +6624,7 @@ def test_update_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tag.name=tag.name/value", + "tag.name=name_value", ) in kw["metadata"] @@ -6638,7 +6638,7 @@ async def test_update_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_tag.UpdateTagRequest() - request.tag.name = "tag.name/value" + request.tag.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tag), "__call__") as call: @@ -6654,7 +6654,7 @@ async def test_update_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tag.name=tag.name/value", + "tag.name=name_value", ) in kw["metadata"] @@ -6838,7 +6838,7 @@ def test_delete_tag_field_headers(): # a field header. Set these to a non-empty value. request = tag.DeleteTagRequest() - 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_tag), "__call__") as call: @@ -6854,7 +6854,7 @@ def test_delete_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6868,7 +6868,7 @@ async def test_delete_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = tag.DeleteTagRequest() - 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_tag), "__call__") as call: @@ -6884,7 +6884,7 @@ async def test_delete_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7070,7 +7070,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -7086,7 +7086,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -7100,7 +7100,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -7116,7 +7116,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -7240,7 +7240,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -7256,7 +7256,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -7270,7 +7270,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -7286,7 +7286,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -7412,7 +7412,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7430,7 +7430,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -7444,7 +7444,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7464,7 +7464,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -7601,7 +7601,7 @@ def test_get_project_settings_field_headers(): # a field header. Set these to a non-empty value. request = settings.GetProjectSettingsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7619,7 +7619,7 @@ def test_get_project_settings_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7633,7 +7633,7 @@ async def test_get_project_settings_field_headers_async(): # a field header. Set these to a non-empty value. request = settings.GetProjectSettingsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7653,7 +7653,7 @@ async def test_get_project_settings_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7857,7 +7857,7 @@ def test_update_project_settings_field_headers(): # a field header. Set these to a non-empty value. request = settings.UpdateProjectSettingsRequest() - request.project_settings.name = "project_settings.name/value" + request.project_settings.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7875,7 +7875,7 @@ def test_update_project_settings_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project_settings.name=project_settings.name/value", + "project_settings.name=name_value", ) in kw["metadata"] @@ -7889,7 +7889,7 @@ async def test_update_project_settings_field_headers_async(): # a field header. Set these to a non-empty value. request = settings.UpdateProjectSettingsRequest() - request.project_settings.name = "project_settings.name/value" + request.project_settings.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7909,7 +7909,7 @@ async def test_update_project_settings_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project_settings.name=project_settings.name/value", + "project_settings.name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py b/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py index 36e3762..743a2c5 100644 --- a/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py +++ b/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py @@ -782,7 +782,7 @@ def test_import_apt_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = apt_artifact.ImportAptArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -800,7 +800,7 @@ def test_import_apt_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -814,7 +814,7 @@ async def test_import_apt_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = apt_artifact.ImportAptArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -834,7 +834,7 @@ async def test_import_apt_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -936,7 +936,7 @@ def test_import_yum_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = yum_artifact.ImportYumArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -954,7 +954,7 @@ def test_import_yum_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -968,7 +968,7 @@ async def test_import_yum_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = yum_artifact.ImportYumArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -988,7 +988,7 @@ async def test_import_yum_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1096,7 +1096,7 @@ def test_list_repositories_field_headers(): # a field header. Set these to a non-empty value. request = repository.ListRepositoriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1114,7 +1114,7 @@ def test_list_repositories_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1128,7 +1128,7 @@ async def test_list_repositories_field_headers_async(): # a field header. Set these to a non-empty value. request = repository.ListRepositoriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1148,7 +1148,7 @@ async def test_list_repositories_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1285,7 +1285,7 @@ def test_list_repositories_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, repository.Repository) for i in results) @@ -1547,7 +1547,7 @@ def test_get_repository_field_headers(): # a field header. Set these to a non-empty value. request = repository.GetRepositoryRequest() - 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_repository), "__call__") as call: @@ -1563,7 +1563,7 @@ def test_get_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1577,7 +1577,7 @@ async def test_get_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = repository.GetRepositoryRequest() - 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_repository), "__call__") as call: @@ -1595,7 +1595,7 @@ async def test_get_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1779,7 +1779,7 @@ def test_create_repository_field_headers(): # a field header. Set these to a non-empty value. request = gda_repository.CreateRepositoryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1797,7 +1797,7 @@ def test_create_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1811,7 +1811,7 @@ async def test_create_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_repository.CreateRepositoryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1831,7 +1831,7 @@ async def test_create_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2084,7 +2084,7 @@ def test_update_repository_field_headers(): # a field header. Set these to a non-empty value. request = gda_repository.UpdateRepositoryRequest() - request.repository.name = "repository.name/value" + request.repository.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2102,7 +2102,7 @@ def test_update_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "repository.name=repository.name/value", + "repository.name=name_value", ) in kw["metadata"] @@ -2116,7 +2116,7 @@ async def test_update_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_repository.UpdateRepositoryRequest() - request.repository.name = "repository.name/value" + request.repository.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2136,7 +2136,7 @@ async def test_update_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "repository.name=repository.name/value", + "repository.name=name_value", ) in kw["metadata"] @@ -2358,7 +2358,7 @@ def test_delete_repository_field_headers(): # a field header. Set these to a non-empty value. request = repository.DeleteRepositoryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2376,7 +2376,7 @@ def test_delete_repository_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2390,7 +2390,7 @@ async def test_delete_repository_field_headers_async(): # a field header. Set these to a non-empty value. request = repository.DeleteRepositoryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2410,7 +2410,7 @@ async def test_delete_repository_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2598,7 +2598,7 @@ def test_list_packages_field_headers(): # a field header. Set these to a non-empty value. request = package.ListPackagesRequest() - 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_packages), "__call__") as call: @@ -2614,7 +2614,7 @@ def test_list_packages_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2628,7 +2628,7 @@ async def test_list_packages_field_headers_async(): # a field header. Set these to a non-empty value. request = package.ListPackagesRequest() - 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_packages), "__call__") as call: @@ -2646,7 +2646,7 @@ async def test_list_packages_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2777,7 +2777,7 @@ def test_list_packages_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, package.Package) for i in results) @@ -3022,7 +3022,7 @@ def test_get_package_field_headers(): # a field header. Set these to a non-empty value. request = package.GetPackageRequest() - 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_package), "__call__") as call: @@ -3038,7 +3038,7 @@ def test_get_package_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3052,7 +3052,7 @@ async def test_get_package_field_headers_async(): # a field header. Set these to a non-empty value. request = package.GetPackageRequest() - 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_package), "__call__") as call: @@ -3068,7 +3068,7 @@ async def test_get_package_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3244,7 +3244,7 @@ def test_delete_package_field_headers(): # a field header. Set these to a non-empty value. request = package.DeletePackageRequest() - 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_package), "__call__") as call: @@ -3260,7 +3260,7 @@ def test_delete_package_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3274,7 +3274,7 @@ async def test_delete_package_field_headers_async(): # a field header. Set these to a non-empty value. request = package.DeletePackageRequest() - 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_package), "__call__") as call: @@ -3292,7 +3292,7 @@ async def test_delete_package_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3476,7 +3476,7 @@ def test_list_versions_field_headers(): # a field header. Set these to a non-empty value. request = version.ListVersionsRequest() - 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_versions), "__call__") as call: @@ -3492,7 +3492,7 @@ def test_list_versions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3506,7 +3506,7 @@ async def test_list_versions_field_headers_async(): # a field header. Set these to a non-empty value. request = version.ListVersionsRequest() - 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_versions), "__call__") as call: @@ -3524,7 +3524,7 @@ async def test_list_versions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3655,7 +3655,7 @@ def test_list_versions_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, version.Version) for i in results) @@ -3900,7 +3900,7 @@ def test_get_version_field_headers(): # a field header. Set these to a non-empty value. request = version.GetVersionRequest() - 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_version), "__call__") as call: @@ -3916,7 +3916,7 @@ def test_get_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3930,7 +3930,7 @@ async def test_get_version_field_headers_async(): # a field header. Set these to a non-empty value. request = version.GetVersionRequest() - 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_version), "__call__") as call: @@ -3946,7 +3946,7 @@ async def test_get_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4122,7 +4122,7 @@ def test_delete_version_field_headers(): # a field header. Set these to a non-empty value. request = version.DeleteVersionRequest() - 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_version), "__call__") as call: @@ -4138,7 +4138,7 @@ def test_delete_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4152,7 +4152,7 @@ async def test_delete_version_field_headers_async(): # a field header. Set these to a non-empty value. request = version.DeleteVersionRequest() - 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_version), "__call__") as call: @@ -4170,7 +4170,7 @@ async def test_delete_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4354,7 +4354,7 @@ def test_list_files_field_headers(): # a field header. Set these to a non-empty value. request = file.ListFilesRequest() - 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_files), "__call__") as call: @@ -4370,7 +4370,7 @@ def test_list_files_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4384,7 +4384,7 @@ async def test_list_files_field_headers_async(): # a field header. Set these to a non-empty value. request = file.ListFilesRequest() - 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_files), "__call__") as call: @@ -4402,7 +4402,7 @@ async def test_list_files_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4533,7 +4533,7 @@ def test_list_files_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, file.File) for i in results) @@ -4782,7 +4782,7 @@ def test_get_file_field_headers(): # a field header. Set these to a non-empty value. request = file.GetFileRequest() - 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_file), "__call__") as call: @@ -4798,7 +4798,7 @@ def test_get_file_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4812,7 +4812,7 @@ async def test_get_file_field_headers_async(): # a field header. Set these to a non-empty value. request = file.GetFileRequest() - 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_file), "__call__") as call: @@ -4828,7 +4828,7 @@ async def test_get_file_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5010,7 +5010,7 @@ def test_list_tags_field_headers(): # a field header. Set these to a non-empty value. request = tag.ListTagsRequest() - 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_tags), "__call__") as call: @@ -5026,7 +5026,7 @@ def test_list_tags_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5040,7 +5040,7 @@ async def test_list_tags_field_headers_async(): # a field header. Set these to a non-empty value. request = tag.ListTagsRequest() - 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_tags), "__call__") as call: @@ -5058,7 +5058,7 @@ async def test_list_tags_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5189,7 +5189,7 @@ def test_list_tags_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, tag.Tag) for i in results) @@ -5434,7 +5434,7 @@ def test_get_tag_field_headers(): # a field header. Set these to a non-empty value. request = tag.GetTagRequest() - 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_tag), "__call__") as call: @@ -5450,7 +5450,7 @@ def test_get_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5464,7 +5464,7 @@ async def test_get_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = tag.GetTagRequest() - 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_tag), "__call__") as call: @@ -5480,7 +5480,7 @@ async def test_get_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5666,7 +5666,7 @@ def test_create_tag_field_headers(): # a field header. Set these to a non-empty value. request = gda_tag.CreateTagRequest() - 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_tag), "__call__") as call: @@ -5682,7 +5682,7 @@ def test_create_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5696,7 +5696,7 @@ async def test_create_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_tag.CreateTagRequest() - 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_tag), "__call__") as call: @@ -5712,7 +5712,7 @@ async def test_create_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5918,7 +5918,7 @@ def test_update_tag_field_headers(): # a field header. Set these to a non-empty value. request = gda_tag.UpdateTagRequest() - request.tag.name = "tag.name/value" + request.tag.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tag), "__call__") as call: @@ -5934,7 +5934,7 @@ def test_update_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tag.name=tag.name/value", + "tag.name=name_value", ) in kw["metadata"] @@ -5948,7 +5948,7 @@ async def test_update_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = gda_tag.UpdateTagRequest() - request.tag.name = "tag.name/value" + request.tag.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tag), "__call__") as call: @@ -5964,7 +5964,7 @@ async def test_update_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tag.name=tag.name/value", + "tag.name=name_value", ) in kw["metadata"] @@ -6148,7 +6148,7 @@ def test_delete_tag_field_headers(): # a field header. Set these to a non-empty value. request = tag.DeleteTagRequest() - 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_tag), "__call__") as call: @@ -6164,7 +6164,7 @@ def test_delete_tag_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6178,7 +6178,7 @@ async def test_delete_tag_field_headers_async(): # a field header. Set these to a non-empty value. request = tag.DeleteTagRequest() - 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_tag), "__call__") as call: @@ -6194,7 +6194,7 @@ async def test_delete_tag_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6380,7 +6380,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -6396,7 +6396,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -6410,7 +6410,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -6426,7 +6426,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -6550,7 +6550,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -6566,7 +6566,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -6580,7 +6580,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -6596,7 +6596,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -6722,7 +6722,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6740,7 +6740,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -6754,7 +6754,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6774,7 +6774,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -6911,7 +6911,7 @@ def test_get_project_settings_field_headers(): # a field header. Set these to a non-empty value. request = settings.GetProjectSettingsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6929,7 +6929,7 @@ def test_get_project_settings_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6943,7 +6943,7 @@ async def test_get_project_settings_field_headers_async(): # a field header. Set these to a non-empty value. request = settings.GetProjectSettingsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6963,7 +6963,7 @@ async def test_get_project_settings_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7167,7 +7167,7 @@ def test_update_project_settings_field_headers(): # a field header. Set these to a non-empty value. request = settings.UpdateProjectSettingsRequest() - request.project_settings.name = "project_settings.name/value" + request.project_settings.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7185,7 +7185,7 @@ def test_update_project_settings_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project_settings.name=project_settings.name/value", + "project_settings.name=name_value", ) in kw["metadata"] @@ -7199,7 +7199,7 @@ async def test_update_project_settings_field_headers_async(): # a field header. Set these to a non-empty value. request = settings.UpdateProjectSettingsRequest() - request.project_settings.name = "project_settings.name/value" + request.project_settings.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7219,7 +7219,7 @@ async def test_update_project_settings_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project_settings.name=project_settings.name/value", + "project_settings.name=name_value", ) in kw["metadata"] From 28053cfd591201a00de16f7fab49017cd27cbd92 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 12:13:46 -0400 Subject: [PATCH 2/8] chore: [autoapprove] update readme_gen.py to include autoescape True (#160) Source-Link: https://github.com/googleapis/synthtool/commit/6b4d5a6407d740beb4158b302194a62a4108a8a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- scripts/readme-gen/readme_gen.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6..b631901 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 +# created: 2022-05-05T15:17:27.599381182Z diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') From 56d87bad8cbef260de4ccb202290f55a71d6ec7d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 23:24:17 +0000 Subject: [PATCH 3/8] chore(python): auto approve template changes (#162) Source-Link: https://github.com/googleapis/synthtool/commit/453a5d9c9a55d1969240a37d36cec626d20a9024 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-approve.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b631901..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 -# created: 2022-05-05T15:17:27.599381182Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" From 15d799c0fc3a9ce32e2e933aec6e0b410d47aefb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 17:32:30 +0000 Subject: [PATCH 4/8] chore: use gapic-generator-python 1.0.0 (#163) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 451250442 Source-Link: https://github.com/googleapis/googleapis/commit/cca5e8181f6442b134e8d4d206fbe9e0e74684ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/0b219da161a8bdcc3c6f7b2efcd82105182a30ca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9 --- .../artifactregistry_v1/test_artifact_registry.py | 11 +++++++++-- .../test_artifact_registry.py | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py b/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py index 9e558e3..5233967 100644 --- a/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py +++ b/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py @@ -13,9 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import math import os +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock + +import math + from google.api_core import ( future, gapic_v1, @@ -42,7 +50,6 @@ from google.type import expr_pb2 # type: ignore import grpc from grpc.experimental import aio -import mock from proto.marshal.rules.dates import DurationRule, TimestampRule import pytest diff --git a/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py b/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py index 743a2c5..378005a 100644 --- a/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py +++ b/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py @@ -13,9 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import math import os +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock + +import math + from google.api_core import ( future, gapic_v1, @@ -42,7 +50,6 @@ from google.type import expr_pb2 # type: ignore import grpc from grpc.experimental import aio -import mock from proto.marshal.rules.dates import DurationRule, TimestampRule import pytest From 3f57f9a14b3e8a93abefe5f57a8e5066ff7a3b6f Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 1 Jun 2022 22:30:03 -0400 Subject: [PATCH 5/8] fix(deps): require protobuf <4.0.0dev (#164) --- setup.py | 3 ++- testing/constraints-3.6.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 957b8ca..2fbb224 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "proto-plus >= 1.15.0", + "proto-plus >= 1.15.0, <2.0.0dev", + "protobuf >= 3.19.0, <4.0.0dev", "grpc-google-iam-v1 >=0.12.4, <1.0.0dev", ] diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index a8cc045..7940f68 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -22,3 +22,4 @@ google-api-core==1.31.5 grpc-google-iam-v1==0.12.4 proto-plus==1.15.0 +protobuf==3.19.0 From 57f37c956ef4adf6800ba45f20266693e9f11b57 Mon Sep 17 00:00:00 2001 From: Dan Lee <71398022+dandhlee@users.noreply.github.com> Date: Thu, 2 Jun 2022 20:40:36 -0400 Subject: [PATCH 6/8] docs: fix changelog header to consistent size (#165) Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d84dda2..4359f84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ * **deps:** require grpc-google-iam-v1 >=0.12.4 ([c22893b](https://github.com/googleapis/python-artifact-registry/commit/c22893b8e671fea8416ff1e6a4f23aa03e201e74)) -### [1.1.2](https://github.com/googleapis/python-artifact-registry/compare/v1.1.1...v1.1.2) (2022-03-05) +## [1.1.2](https://github.com/googleapis/python-artifact-registry/compare/v1.1.1...v1.1.2) (2022-03-05) ### Bug Fixes @@ -26,7 +26,7 @@ * more details for ListFilesRequest parent field ([#133](https://github.com/googleapis/python-artifact-registry/issues/133)) ([f4ef78b](https://github.com/googleapis/python-artifact-registry/commit/f4ef78b6b108543bf07d8c564f4316a8314e8d54)) -### [1.1.1](https://github.com/googleapis/python-artifact-registry/compare/v1.1.0...v1.1.1) (2022-02-15) +## [1.1.1](https://github.com/googleapis/python-artifact-registry/compare/v1.1.0...v1.1.1) (2022-02-15) ### Bug Fixes @@ -55,14 +55,14 @@ * mark a few resource name fields as required ([a86d4f1](https://github.com/googleapis/python-artifact-registry/commit/a86d4f143c401e20052182b7bba3b9178014dace)) -### [1.0.2](https://www.github.com/googleapis/python-artifact-registry/compare/v1.0.1...v1.0.2) (2022-01-07) +## [1.0.2](https://www.github.com/googleapis/python-artifact-registry/compare/v1.0.1...v1.0.2) (2022-01-07) ### Bug Fixes * fix resource pattern ID segment name ([#107](https://www.github.com/googleapis/python-artifact-registry/issues/107)) ([254dc73](https://www.github.com/googleapis/python-artifact-registry/commit/254dc73dbbc52d41014e0d2db81f3cc6cd864058)) -### [1.0.1](https://www.github.com/googleapis/python-artifact-registry/compare/v1.0.0...v1.0.1) (2021-11-01) +## [1.0.1](https://www.github.com/googleapis/python-artifact-registry/compare/v1.0.0...v1.0.1) (2021-11-01) ### Bug Fixes @@ -95,7 +95,7 @@ * add context manager support in client ([#88](https://www.github.com/googleapis/python-artifact-registry/issues/88)) ([0f631cc](https://www.github.com/googleapis/python-artifact-registry/commit/0f631cc8bd8ff0928d5403e756d2206f1842c35c)) * add trove classifier for python 3.10 ([#91](https://www.github.com/googleapis/python-artifact-registry/issues/91)) ([e392f56](https://www.github.com/googleapis/python-artifact-registry/commit/e392f565e5e9252bff8a5f6ede67c11b25438cdd)) -### [0.4.1](https://www.github.com/googleapis/python-artifact-registry/compare/v0.4.0...v0.4.1) (2021-09-30) +## [0.4.1](https://www.github.com/googleapis/python-artifact-registry/compare/v0.4.0...v0.4.1) (2021-09-30) ### Bug Fixes @@ -115,7 +115,7 @@ * add 'dict' annotation type to 'request' ([43413eb](https://www.github.com/googleapis/python-artifact-registry/commit/43413ebd0d6823233573ab88c0340e4165ee4487)) -### [0.3.3](https://www.github.com/googleapis/python-artifact-registry/compare/v0.3.2...v0.3.3) (2021-07-27) +## [0.3.3](https://www.github.com/googleapis/python-artifact-registry/compare/v0.3.2...v0.3.3) (2021-07-27) ### Bug Fixes @@ -132,14 +132,14 @@ * release as 0.3.3 ([#60](https://www.github.com/googleapis/python-artifact-registry/issues/60)) ([b8d7865](https://www.github.com/googleapis/python-artifact-registry/commit/b8d78650cceae268f6616c4eefef3200c7477cc1)) -### [0.3.2](https://www.github.com/googleapis/python-artifact-registry/compare/v0.3.1...v0.3.2) (2021-07-20) +## [0.3.2](https://www.github.com/googleapis/python-artifact-registry/compare/v0.3.1...v0.3.2) (2021-07-20) ### Bug Fixes * **deps:** pin 'google-{api,cloud}-core', 'google-auth' to allow 2.x versions ([#54](https://www.github.com/googleapis/python-artifact-registry/issues/54)) ([b171295](https://www.github.com/googleapis/python-artifact-registry/commit/b171295c19c0e29025aad08975ceb9a8c9aac66c)) -### [0.3.1](https://www.github.com/googleapis/python-artifact-registry/compare/v0.3.0...v0.3.1) (2021-06-30) +## [0.3.1](https://www.github.com/googleapis/python-artifact-registry/compare/v0.3.0...v0.3.1) (2021-06-30) ### Bug Fixes @@ -159,14 +159,14 @@ * omit mention of Python 2.7 in 'CONTRIBUTING.rst' ([#1127](https://www.github.com/googleapis/python-artifact-registry/issues/1127)) ([#41](https://www.github.com/googleapis/python-artifact-registry/issues/41)) ([7ae05ed](https://www.github.com/googleapis/python-artifact-registry/commit/7ae05eddef4fce0f3f09774e835381f901a6a031)), closes [#1126](https://www.github.com/googleapis/python-artifact-registry/issues/1126) -### [0.2.2](https://www.github.com/googleapis/python-artifact-registry/compare/v0.2.1...v0.2.2) (2021-06-16) +## [0.2.2](https://www.github.com/googleapis/python-artifact-registry/compare/v0.2.1...v0.2.2) (2021-06-16) ### Bug Fixes * exclude docs and tests from package ([#38](https://www.github.com/googleapis/python-artifact-registry/issues/38)) ([345496f](https://www.github.com/googleapis/python-artifact-registry/commit/345496fbd96d4c780acdb2ee940e530e7d48ab6c)) -### [0.2.1](https://www.github.com/googleapis/python-artifact-registry/compare/v0.2.0...v0.2.1) (2021-06-01) +## [0.2.1](https://www.github.com/googleapis/python-artifact-registry/compare/v0.2.0...v0.2.1) (2021-06-01) ### Bug Fixes From cbcd28bf107dd60d8959d0620fbec95604fe803b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 3 Jun 2022 12:56:34 -0400 Subject: [PATCH 7/8] chore: test minimum dependencies in python 3.7 (#168) --- testing/constraints-3.7.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index e69de29..7940f68 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1,25 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +google-api-core==1.31.5 +grpc-google-iam-v1==0.12.4 +proto-plus==1.15.0 +protobuf==3.19.0 From 0b9f76b52f99679900a7ae763adb348bf561b42e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 18:20:32 -0400 Subject: [PATCH 8/8] chore(main): release 1.2.1 (#166) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 12 ++++++++++++ setup.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4359f84..78c36bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.2.1](https://github.com/googleapis/python-artifact-registry/compare/v1.2.0...v1.2.1) (2022-06-03) + + +### Bug Fixes + +* **deps:** require protobuf <4.0.0dev ([#164](https://github.com/googleapis/python-artifact-registry/issues/164)) ([3f57f9a](https://github.com/googleapis/python-artifact-registry/commit/3f57f9a14b3e8a93abefe5f57a8e5066ff7a3b6f)) + + +### Documentation + +* fix changelog header to consistent size ([#165](https://github.com/googleapis/python-artifact-registry/issues/165)) ([57f37c9](https://github.com/googleapis/python-artifact-registry/commit/57f37c956ef4adf6800ba45f20266693e9f11b57)) + ## [1.2.0](https://github.com/googleapis/python-artifact-registry/compare/v1.1.2...v1.2.0) (2022-04-21) diff --git a/setup.py b/setup.py index 2fbb224..6a639fc 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import setuptools # type: ignore name = "google-cloud-artifact-registry" -version = "1.2.0" +version = "1.2.1" description = "Artifact Registry API client library" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-artifact-registry"