diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6..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:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + 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" diff --git a/CHANGELOG.md b/CHANGELOG.md index d84dda2..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) @@ -13,7 +25,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 +38,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 +67,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 +107,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 +127,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 +144,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 +171,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 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/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') diff --git a/setup.py b/setup.py index 957b8ca..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" @@ -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 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 diff --git a/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py b/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py index de16a2a..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 @@ -788,7 +795,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 +813,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 +827,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 +847,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 +984,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 +1247,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 +1263,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 +1277,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 +1295,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 +1479,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 +1497,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 +1511,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 +1531,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 +1633,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 +1651,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 +1665,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 +1685,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 +1793,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 +1811,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 +1825,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 +1845,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 +1982,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 +2244,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 +2260,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 +2274,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 +2292,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 +2476,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 +2494,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 +2508,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 +2528,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 +2781,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 +2799,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 +2813,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 +2833,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 +3055,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 +3073,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 +3087,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 +3107,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 +3295,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 +3311,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 +3325,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 +3343,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 +3474,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 +3719,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 +3735,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 +3749,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 +3765,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 +3941,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 +3957,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 +3971,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 +3989,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 +4173,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 +4189,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 +4203,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 +4221,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 +4352,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 +4597,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 +4613,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 +4627,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 +4643,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 +4819,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 +4835,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 +4849,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 +4867,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 +5051,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 +5067,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 +5081,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 +5099,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 +5230,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 +5479,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 +5495,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 +5509,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 +5525,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 +5707,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 +5723,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 +5737,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 +5755,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 +5886,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 +6131,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 +6147,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 +6161,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 +6177,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 +6363,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 +6379,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 +6393,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 +6409,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 +6615,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 +6631,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 +6645,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 +6661,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 +6845,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 +6861,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 +6875,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 +6891,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 +7077,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 +7093,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 +7107,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 +7123,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 +7247,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 +7263,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 +7277,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 +7293,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 +7419,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 +7437,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 +7451,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 +7471,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 +7608,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 +7626,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 +7640,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 +7660,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 +7864,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 +7882,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 +7896,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 +7916,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..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 @@ -782,7 +789,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 +807,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 +821,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 +841,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 +943,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 +961,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 +975,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 +995,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 +1103,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 +1121,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 +1135,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 +1155,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 +1292,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 +1554,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 +1570,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 +1584,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 +1602,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 +1786,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 +1804,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 +1818,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 +1838,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 +2091,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 +2109,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 +2123,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 +2143,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 +2365,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 +2383,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 +2397,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 +2417,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 +2605,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 +2621,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 +2635,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 +2653,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 +2784,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 +3029,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 +3045,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 +3059,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 +3075,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 +3251,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 +3267,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 +3281,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 +3299,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 +3483,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 +3499,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 +3513,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 +3531,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 +3662,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 +3907,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 +3923,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 +3937,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 +3953,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 +4129,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 +4145,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 +4159,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 +4177,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 +4361,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 +4377,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 +4391,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 +4409,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 +4540,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 +4789,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 +4805,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 +4819,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 +4835,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 +5017,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 +5033,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 +5047,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 +5065,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 +5196,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 +5441,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 +5457,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 +5471,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 +5487,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 +5673,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 +5689,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 +5703,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 +5719,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 +5925,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 +5941,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 +5955,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 +5971,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 +6155,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 +6171,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 +6185,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 +6201,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 +6387,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 +6403,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 +6417,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 +6433,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 +6557,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 +6573,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 +6587,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 +6603,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 +6729,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 +6747,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 +6761,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 +6781,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 +6918,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 +6936,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 +6950,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 +6970,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 +7174,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 +7192,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 +7206,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 +7226,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"]