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 e6f5862..efb1142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.0.1](https://github.com/googleapis/python-bare-metal-solution/compare/v1.0.0...v1.0.1) (2022-06-07) + + +### Bug Fixes + +* **deps:** require protobuf>=3.19.0,<4.0.0 ([#29](https://github.com/googleapis/python-bare-metal-solution/issues/29)) ([c3ffc61](https://github.com/googleapis/python-bare-metal-solution/commit/c3ffc61e53b7f14a7ca15304862f5fc18e10b3df)) + + +### Documentation + +* fix changelog header to consistent size ([#27](https://github.com/googleapis/python-bare-metal-solution/issues/27)) ([15d9556](https://github.com/googleapis/python-bare-metal-solution/commit/15d95563aa6043f45dd9c064c21c5e46a1193674)) + ## [1.0.0](https://github.com/googleapis/python-bare-metal-solution/compare/v0.1.1...v1.0.0) (2022-04-26) @@ -7,7 +19,7 @@ * bump release level to production/stable ([#19](https://github.com/googleapis/python-bare-metal-solution/issues/19)) ([e4bc62a](https://github.com/googleapis/python-bare-metal-solution/commit/e4bc62a66040934b659ca9bc2f85b1409ae59d25)) -### [0.1.1](https://github.com/googleapis/python-bare-metal-solution/compare/v0.1.0...v0.1.1) (2022-04-21) +## [0.1.1](https://github.com/googleapis/python-bare-metal-solution/compare/v0.1.0...v0.1.1) (2022-04-21) ### Documentation diff --git a/google/cloud/bare_metal_solution_v2/services/bare_metal_solution/async_client.py b/google/cloud/bare_metal_solution_v2/services/bare_metal_solution/async_client.py index f9cc367..9345fa9 100644 --- a/google/cloud/bare_metal_solution_v2/services/bare_metal_solution/async_client.py +++ b/google/cloud/bare_metal_solution_v2/services/bare_metal_solution/async_client.py @@ -246,9 +246,9 @@ async def list_instances( from google.cloud import bare_metal_solution_v2 - def sample_list_instances(): + async def sample_list_instances(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ListInstancesRequest( @@ -259,7 +259,7 @@ def sample_list_instances(): page_result = client.list_instances(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -354,9 +354,9 @@ async def get_instance( from google.cloud import bare_metal_solution_v2 - def sample_get_instance(): + async def sample_get_instance(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.GetInstanceRequest( @@ -364,7 +364,7 @@ def sample_get_instance(): ) # Make the request - response = client.get_instance(request=request) + response = await client.get_instance(request=request) # Handle the response print(response) @@ -447,9 +447,9 @@ async def reset_instance( from google.cloud import bare_metal_solution_v2 - def sample_reset_instance(): + async def sample_reset_instance(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ResetInstanceRequest( @@ -461,7 +461,7 @@ def sample_reset_instance(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -555,9 +555,9 @@ async def list_volumes( from google.cloud import bare_metal_solution_v2 - def sample_list_volumes(): + async def sample_list_volumes(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ListVolumesRequest( @@ -568,7 +568,7 @@ def sample_list_volumes(): page_result = client.list_volumes(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -663,9 +663,9 @@ async def get_volume( from google.cloud import bare_metal_solution_v2 - def sample_get_volume(): + async def sample_get_volume(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.GetVolumeRequest( @@ -673,7 +673,7 @@ def sample_get_volume(): ) # Make the request - response = client.get_volume(request=request) + response = await client.get_volume(request=request) # Handle the response print(response) @@ -755,9 +755,9 @@ async def update_volume( from google.cloud import bare_metal_solution_v2 - def sample_update_volume(): + async def sample_update_volume(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.UpdateVolumeRequest( @@ -768,7 +768,7 @@ def sample_update_volume(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -878,9 +878,9 @@ async def list_networks( from google.cloud import bare_metal_solution_v2 - def sample_list_networks(): + async def sample_list_networks(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ListNetworksRequest( @@ -891,7 +891,7 @@ def sample_list_networks(): page_result = client.list_networks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -986,9 +986,9 @@ async def get_network( from google.cloud import bare_metal_solution_v2 - def sample_get_network(): + async def sample_get_network(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.GetNetworkRequest( @@ -996,7 +996,7 @@ def sample_get_network(): ) # Make the request - response = client.get_network(request=request) + response = await client.get_network(request=request) # Handle the response print(response) @@ -1080,9 +1080,9 @@ async def list_snapshot_schedule_policies( from google.cloud import bare_metal_solution_v2 - def sample_list_snapshot_schedule_policies(): + async def sample_list_snapshot_schedule_policies(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ListSnapshotSchedulePoliciesRequest( @@ -1093,7 +1093,7 @@ def sample_list_snapshot_schedule_policies(): page_result = client.list_snapshot_schedule_policies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1189,9 +1189,9 @@ async def get_snapshot_schedule_policy( from google.cloud import bare_metal_solution_v2 - def sample_get_snapshot_schedule_policy(): + async def sample_get_snapshot_schedule_policy(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.GetSnapshotSchedulePolicyRequest( @@ -1199,7 +1199,7 @@ def sample_get_snapshot_schedule_policy(): ) # Make the request - response = client.get_snapshot_schedule_policy(request=request) + response = await client.get_snapshot_schedule_policy(request=request) # Handle the response print(response) @@ -1285,9 +1285,9 @@ async def create_snapshot_schedule_policy( from google.cloud import bare_metal_solution_v2 - def sample_create_snapshot_schedule_policy(): + async def sample_create_snapshot_schedule_policy(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.CreateSnapshotSchedulePolicyRequest( @@ -1296,7 +1296,7 @@ def sample_create_snapshot_schedule_policy(): ) # Make the request - response = client.create_snapshot_schedule_policy(request=request) + response = await client.create_snapshot_schedule_policy(request=request) # Handle the response print(response) @@ -1402,16 +1402,16 @@ async def update_snapshot_schedule_policy( from google.cloud import bare_metal_solution_v2 - def sample_update_snapshot_schedule_policy(): + async def sample_update_snapshot_schedule_policy(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.UpdateSnapshotSchedulePolicyRequest( ) # Make the request - response = client.update_snapshot_schedule_policy(request=request) + response = await client.update_snapshot_schedule_policy(request=request) # Handle the response print(response) @@ -1515,9 +1515,9 @@ async def delete_snapshot_schedule_policy( from google.cloud import bare_metal_solution_v2 - def sample_delete_snapshot_schedule_policy(): + async def sample_delete_snapshot_schedule_policy(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.DeleteSnapshotSchedulePolicyRequest( @@ -1525,7 +1525,7 @@ def sample_delete_snapshot_schedule_policy(): ) # Make the request - client.delete_snapshot_schedule_policy(request=request) + await client.delete_snapshot_schedule_policy(request=request) Args: request (Union[google.cloud.bare_metal_solution_v2.types.DeleteSnapshotSchedulePolicyRequest, dict]): @@ -1600,9 +1600,9 @@ async def create_volume_snapshot( from google.cloud import bare_metal_solution_v2 - def sample_create_volume_snapshot(): + async def sample_create_volume_snapshot(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.CreateVolumeSnapshotRequest( @@ -1610,7 +1610,7 @@ def sample_create_volume_snapshot(): ) # Make the request - response = client.create_volume_snapshot(request=request) + response = await client.create_volume_snapshot(request=request) # Handle the response print(response) @@ -1704,9 +1704,9 @@ async def restore_volume_snapshot( from google.cloud import bare_metal_solution_v2 - def sample_restore_volume_snapshot(): + async def sample_restore_volume_snapshot(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.RestoreVolumeSnapshotRequest( @@ -1718,7 +1718,7 @@ def sample_restore_volume_snapshot(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1814,9 +1814,9 @@ async def delete_volume_snapshot( from google.cloud import bare_metal_solution_v2 - def sample_delete_volume_snapshot(): + async def sample_delete_volume_snapshot(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.DeleteVolumeSnapshotRequest( @@ -1824,7 +1824,7 @@ def sample_delete_volume_snapshot(): ) # Make the request - client.delete_volume_snapshot(request=request) + await client.delete_volume_snapshot(request=request) Args: request (Union[google.cloud.bare_metal_solution_v2.types.DeleteVolumeSnapshotRequest, dict]): @@ -1897,9 +1897,9 @@ async def get_volume_snapshot( from google.cloud import bare_metal_solution_v2 - def sample_get_volume_snapshot(): + async def sample_get_volume_snapshot(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.GetVolumeSnapshotRequest( @@ -1907,7 +1907,7 @@ def sample_get_volume_snapshot(): ) # Make the request - response = client.get_volume_snapshot(request=request) + response = await client.get_volume_snapshot(request=request) # Handle the response print(response) @@ -1991,9 +1991,9 @@ async def list_volume_snapshots( from google.cloud import bare_metal_solution_v2 - def sample_list_volume_snapshots(): + async def sample_list_volume_snapshots(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ListVolumeSnapshotsRequest( @@ -2004,7 +2004,7 @@ def sample_list_volume_snapshots(): page_result = client.list_volume_snapshots(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2100,9 +2100,9 @@ async def get_lun( from google.cloud import bare_metal_solution_v2 - def sample_get_lun(): + async def sample_get_lun(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.GetLunRequest( @@ -2110,7 +2110,7 @@ def sample_get_lun(): ) # Make the request - response = client.get_lun(request=request) + response = await client.get_lun(request=request) # Handle the response print(response) @@ -2193,9 +2193,9 @@ async def list_luns( from google.cloud import bare_metal_solution_v2 - def sample_list_luns(): + async def sample_list_luns(): # Create a client - client = bare_metal_solution_v2.BareMetalSolutionClient() + client = bare_metal_solution_v2.BareMetalSolutionAsyncClient() # Initialize request argument(s) request = bare_metal_solution_v2.ListLunsRequest( @@ -2206,7 +2206,7 @@ def sample_list_luns(): page_result = client.list_luns(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: 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 2499e40..a51d0fa 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-bare-metal-solution" description = "Bare Metal Solution API client library" -version = "1.0.0" +version = "1.0.1" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-bare-metal-solution" dependencies = [ @@ -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", ] package_root = os.path.abspath(os.path.dirname(__file__)) diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index be5a64f..786e637 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -6,3 +6,4 @@ # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.31.5 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..786e637 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1,9 @@ +# 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 "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.31.5 +proto-plus==1.15.0 +protobuf==3.19.0 diff --git a/tests/unit/gapic/bare_metal_solution_v2/test_bare_metal_solution.py b/tests/unit/gapic/bare_metal_solution_v2/test_bare_metal_solution.py index fc02735..d1e22fc 100644 --- a/tests/unit/gapic/bare_metal_solution_v2/test_bare_metal_solution.py +++ b/tests/unit/gapic/bare_metal_solution_v2/test_bare_metal_solution.py @@ -14,7 +14,13 @@ # limitations under the License. # import os -import mock + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock import grpc from grpc.experimental import aio @@ -773,7 +779,7 @@ def test_list_instances_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListInstancesRequest() - 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_instances), "__call__") as call: @@ -789,7 +795,7 @@ def test_list_instances_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -803,7 +809,7 @@ async def test_list_instances_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListInstancesRequest() - 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_instances), "__call__") as call: @@ -821,7 +827,7 @@ async def test_list_instances_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -952,7 +958,7 @@ def test_list_instances_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, baremetalsolution.Instance) for i in results) @@ -1209,7 +1215,7 @@ def test_get_instance_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetInstanceRequest() - 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_instance), "__call__") as call: @@ -1225,7 +1231,7 @@ def test_get_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1239,7 +1245,7 @@ async def test_get_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetInstanceRequest() - 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_instance), "__call__") as call: @@ -1257,7 +1263,7 @@ async def test_get_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1435,7 +1441,7 @@ def test_reset_instance_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ResetInstanceRequest() - 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.reset_instance), "__call__") as call: @@ -1451,7 +1457,7 @@ def test_reset_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1465,7 +1471,7 @@ async def test_reset_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ResetInstanceRequest() - 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.reset_instance), "__call__") as call: @@ -1483,7 +1489,7 @@ async def test_reset_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1671,7 +1677,7 @@ def test_list_volumes_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListVolumesRequest() - 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_volumes), "__call__") as call: @@ -1687,7 +1693,7 @@ def test_list_volumes_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1701,7 +1707,7 @@ async def test_list_volumes_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListVolumesRequest() - 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_volumes), "__call__") as call: @@ -1719,7 +1725,7 @@ async def test_list_volumes_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1850,7 +1856,7 @@ def test_list_volumes_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, baremetalsolution.Volume) for i in results) @@ -2129,7 +2135,7 @@ def test_get_volume_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetVolumeRequest() - 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_volume), "__call__") as call: @@ -2145,7 +2151,7 @@ def test_get_volume_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2159,7 +2165,7 @@ async def test_get_volume_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetVolumeRequest() - 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_volume), "__call__") as call: @@ -2177,7 +2183,7 @@ async def test_get_volume_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2355,7 +2361,7 @@ def test_update_volume_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.UpdateVolumeRequest() - request.volume.name = "volume.name/value" + request.volume.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_volume), "__call__") as call: @@ -2371,7 +2377,7 @@ def test_update_volume_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "volume.name=volume.name/value", + "volume.name=name_value", ) in kw["metadata"] @@ -2385,7 +2391,7 @@ async def test_update_volume_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.UpdateVolumeRequest() - request.volume.name = "volume.name/value" + request.volume.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_volume), "__call__") as call: @@ -2403,7 +2409,7 @@ async def test_update_volume_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "volume.name=volume.name/value", + "volume.name=name_value", ) in kw["metadata"] @@ -2601,7 +2607,7 @@ def test_list_networks_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListNetworksRequest() - 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_networks), "__call__") as call: @@ -2617,7 +2623,7 @@ def test_list_networks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2631,7 +2637,7 @@ async def test_list_networks_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListNetworksRequest() - 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_networks), "__call__") as call: @@ -2649,7 +2655,7 @@ async def test_list_networks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2780,7 +2786,7 @@ def test_list_networks_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, baremetalsolution.Network) for i in results) @@ -3049,7 +3055,7 @@ def test_get_network_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetNetworkRequest() - 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_network), "__call__") as call: @@ -3065,7 +3071,7 @@ def test_get_network_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3079,7 +3085,7 @@ async def test_get_network_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetNetworkRequest() - 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_network), "__call__") as call: @@ -3097,7 +3103,7 @@ async def test_get_network_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3288,7 +3294,7 @@ def test_list_snapshot_schedule_policies_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListSnapshotSchedulePoliciesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3306,7 +3312,7 @@ def test_list_snapshot_schedule_policies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3320,7 +3326,7 @@ async def test_list_snapshot_schedule_policies_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListSnapshotSchedulePoliciesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3340,7 +3346,7 @@ async def test_list_snapshot_schedule_policies_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3477,7 +3483,7 @@ def test_list_snapshot_schedule_policies_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, baremetalsolution.SnapshotSchedulePolicy) for i in results @@ -3739,7 +3745,7 @@ def test_get_snapshot_schedule_policy_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetSnapshotSchedulePolicyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3757,7 +3763,7 @@ def test_get_snapshot_schedule_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3771,7 +3777,7 @@ async def test_get_snapshot_schedule_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetSnapshotSchedulePolicyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3791,7 +3797,7 @@ async def test_get_snapshot_schedule_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3990,7 +3996,7 @@ def test_create_snapshot_schedule_policy_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.CreateSnapshotSchedulePolicyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4008,7 +4014,7 @@ def test_create_snapshot_schedule_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4022,7 +4028,7 @@ async def test_create_snapshot_schedule_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.CreateSnapshotSchedulePolicyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4042,7 +4048,7 @@ async def test_create_snapshot_schedule_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4269,7 +4275,7 @@ def test_update_snapshot_schedule_policy_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.UpdateSnapshotSchedulePolicyRequest() - request.snapshot_schedule_policy.name = "snapshot_schedule_policy.name/value" + request.snapshot_schedule_policy.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4287,7 +4293,7 @@ def test_update_snapshot_schedule_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot_schedule_policy.name=snapshot_schedule_policy.name/value", + "snapshot_schedule_policy.name=name_value", ) in kw["metadata"] @@ -4301,7 +4307,7 @@ async def test_update_snapshot_schedule_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.UpdateSnapshotSchedulePolicyRequest() - request.snapshot_schedule_policy.name = "snapshot_schedule_policy.name/value" + request.snapshot_schedule_policy.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4321,7 +4327,7 @@ async def test_update_snapshot_schedule_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot_schedule_policy.name=snapshot_schedule_policy.name/value", + "snapshot_schedule_policy.name=name_value", ) in kw["metadata"] @@ -4526,7 +4532,7 @@ def test_delete_snapshot_schedule_policy_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.DeleteSnapshotSchedulePolicyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4544,7 +4550,7 @@ def test_delete_snapshot_schedule_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4558,7 +4564,7 @@ async def test_delete_snapshot_schedule_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.DeleteSnapshotSchedulePolicyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4576,7 +4582,7 @@ async def test_delete_snapshot_schedule_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4781,7 +4787,7 @@ def test_create_volume_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.CreateVolumeSnapshotRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4799,7 +4805,7 @@ def test_create_volume_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4813,7 +4819,7 @@ async def test_create_volume_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.CreateVolumeSnapshotRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4833,7 +4839,7 @@ async def test_create_volume_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5032,7 +5038,7 @@ def test_restore_volume_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.RestoreVolumeSnapshotRequest() - request.volume_snapshot = "volume_snapshot/value" + request.volume_snapshot = "volume_snapshot_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5050,7 +5056,7 @@ def test_restore_volume_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "volume_snapshot=volume_snapshot/value", + "volume_snapshot=volume_snapshot_value", ) in kw["metadata"] @@ -5064,7 +5070,7 @@ async def test_restore_volume_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.RestoreVolumeSnapshotRequest() - request.volume_snapshot = "volume_snapshot/value" + request.volume_snapshot = "volume_snapshot_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5084,7 +5090,7 @@ async def test_restore_volume_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "volume_snapshot=volume_snapshot/value", + "volume_snapshot=volume_snapshot_value", ) in kw["metadata"] @@ -5271,7 +5277,7 @@ def test_delete_volume_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.DeleteVolumeSnapshotRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5289,7 +5295,7 @@ def test_delete_volume_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5303,7 +5309,7 @@ async def test_delete_volume_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.DeleteVolumeSnapshotRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5321,7 +5327,7 @@ async def test_delete_volume_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5526,7 +5532,7 @@ def test_get_volume_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetVolumeSnapshotRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5544,7 +5550,7 @@ def test_get_volume_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5558,7 +5564,7 @@ async def test_get_volume_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetVolumeSnapshotRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5578,7 +5584,7 @@ async def test_get_volume_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5777,7 +5783,7 @@ def test_list_volume_snapshots_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListVolumeSnapshotsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5795,7 +5801,7 @@ def test_list_volume_snapshots_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5809,7 +5815,7 @@ async def test_list_volume_snapshots_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListVolumeSnapshotsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5829,7 +5835,7 @@ async def test_list_volume_snapshots_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5966,7 +5972,7 @@ def test_list_volume_snapshots_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, baremetalsolution.VolumeSnapshot) for i in results) @@ -6245,7 +6251,7 @@ def test_get_lun_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetLunRequest() - 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_lun), "__call__") as call: @@ -6261,7 +6267,7 @@ def test_get_lun_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6275,7 +6281,7 @@ async def test_get_lun_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.GetLunRequest() - 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_lun), "__call__") as call: @@ -6293,7 +6299,7 @@ async def test_get_lun_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6481,7 +6487,7 @@ def test_list_luns_field_headers(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListLunsRequest() - 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_luns), "__call__") as call: @@ -6497,7 +6503,7 @@ def test_list_luns_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6511,7 +6517,7 @@ async def test_list_luns_field_headers_async(): # a field header. Set these to a non-empty value. request = baremetalsolution.ListLunsRequest() - 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_luns), "__call__") as call: @@ -6529,7 +6535,7 @@ async def test_list_luns_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6660,7 +6666,7 @@ def test_list_luns_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, baremetalsolution.Lun) for i in results)