diff --git a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.lock.yaml b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.lock.yaml index 88076277a251..87dd00611576 100644 --- a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/packages/google-cloud-bigquery-reservation/docs/conf.py b/packages/google-cloud-bigquery-reservation/docs/conf.py index 2d83c59394a2..03127911b716 100644 --- a/packages/google-cloud-bigquery-reservation/docs/conf.py +++ b/packages/google-cloud-bigquery-reservation/docs/conf.py @@ -361,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), diff --git a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py index 288db0fd7e1f..4e9287719b66 100644 --- a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py +++ b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py @@ -346,7 +346,12 @@ def sample_create_reservation(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -452,12 +457,20 @@ def sample_list_reservations(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListReservationsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -559,7 +572,12 @@ def sample_get_reservation(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -655,7 +673,10 @@ def sample_delete_reservation(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def update_reservation( @@ -752,7 +773,12 @@ def sample_update_reservation(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -864,7 +890,12 @@ def sample_create_capacity_commitment(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -970,12 +1001,20 @@ def sample_list_capacity_commitments(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListCapacityCommitmentsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1089,7 +1128,12 @@ def sample_get_capacity_commitment(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1185,7 +1229,10 @@ def sample_delete_capacity_commitment(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def update_capacity_commitment( @@ -1304,7 +1351,12 @@ def sample_update_capacity_commitment(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1413,7 +1465,12 @@ def sample_split_capacity_commitment(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1539,7 +1596,12 @@ def sample_merge_capacity_commitments(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1679,7 +1741,12 @@ def sample_create_assignment(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1810,12 +1877,20 @@ def sample_list_assignments(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListAssignmentsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1926,7 +2001,10 @@ def sample_delete_assignment(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def search_assignments( @@ -2076,12 +2154,20 @@ def sample_search_assignments(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchAssignmentsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2217,12 +2303,20 @@ def sample_search_all_assignments(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchAllAssignmentsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2335,7 +2429,12 @@ def sample_move_assignment(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2434,7 +2533,12 @@ def sample_get_bi_reservation(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2539,7 +2643,12 @@ def sample_update_bi_reservation(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/client.py b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/client.py index 596342dec807..7e664261f36c 100644 --- a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/client.py +++ b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/client.py @@ -61,7 +61,8 @@ class ReservationServiceClientMeta(type): _transport_registry["grpc_asyncio"] = ReservationServiceGrpcAsyncIOTransport def get_transport_class( - cls, label: str = None, + cls, + label: str = None, ) -> Type[ReservationServiceTransport]: """Returns an appropriate transport class. @@ -185,7 +186,10 @@ def transport(self) -> ReservationServiceTransport: @staticmethod def assignment_path( - project: str, location: str, reservation: str, assignment: str, + project: str, + location: str, + reservation: str, + assignment: str, ) -> str: """Returns a fully-qualified assignment string.""" return "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format( @@ -205,10 +209,14 @@ def parse_assignment_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def bi_reservation_path(project: str, location: str,) -> str: + def bi_reservation_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified bi_reservation string.""" return "projects/{project}/locations/{location}/biReservation".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -222,11 +230,15 @@ def parse_bi_reservation_path(path: str) -> Dict[str, str]: @staticmethod def capacity_commitment_path( - project: str, location: str, capacity_commitment: str, + project: str, + location: str, + capacity_commitment: str, ) -> str: """Returns a fully-qualified capacity_commitment string.""" return "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( - project=project, location=location, capacity_commitment=capacity_commitment, + project=project, + location=location, + capacity_commitment=capacity_commitment, ) @staticmethod @@ -239,10 +251,18 @@ def parse_capacity_commitment_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def reservation_path(project: str, location: str, reservation: str,) -> str: + def reservation_path( + project: str, + location: str, + reservation: str, + ) -> str: """Returns a fully-qualified reservation string.""" - return "projects/{project}/locations/{location}/reservations/{reservation}".format( - project=project, location=location, reservation=reservation, + return ( + "projects/{project}/locations/{location}/reservations/{reservation}".format( + project=project, + location=location, + reservation=reservation, + ) ) @staticmethod @@ -255,7 +275,9 @@ def parse_reservation_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -268,9 +290,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -279,9 +305,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -290,9 +320,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -301,10 +335,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -585,7 +623,12 @@ def sample_create_reservation(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -681,12 +724,20 @@ def sample_list_reservations(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListReservationsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -778,7 +829,12 @@ def sample_get_reservation(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -864,7 +920,10 @@ def sample_delete_reservation(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def update_reservation( @@ -961,7 +1020,12 @@ def sample_update_reservation(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1075,7 +1139,12 @@ def sample_create_capacity_commitment(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1173,12 +1242,20 @@ def sample_list_capacity_commitments(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListCapacityCommitmentsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1282,7 +1359,12 @@ def sample_get_capacity_commitment(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1370,7 +1452,10 @@ def sample_delete_capacity_commitment(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def update_capacity_commitment( @@ -1491,7 +1576,12 @@ def sample_update_capacity_commitment(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1602,7 +1692,12 @@ def sample_split_capacity_commitment(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1730,7 +1825,12 @@ def sample_merge_capacity_commitments(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1870,7 +1970,12 @@ def sample_create_assignment(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1991,12 +2096,20 @@ def sample_list_assignments(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListAssignmentsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2097,7 +2210,10 @@ def sample_delete_assignment(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def search_assignments( @@ -2237,12 +2353,20 @@ def sample_search_assignments(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchAssignmentsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2378,12 +2502,20 @@ def sample_search_all_assignments(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchAllAssignmentsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2496,7 +2628,12 @@ def sample_move_assignment(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2585,7 +2722,12 @@ def sample_get_bi_reservation(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2690,7 +2832,12 @@ def sample_update_bi_reservation(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/base.py b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/base.py index c3083ca915d1..183b2d7e7a57 100644 --- a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/base.py +++ b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/base.py @@ -126,7 +126,9 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_reservation: gapic_v1.method.wrap_method( - self.create_reservation, default_timeout=300.0, client_info=client_info, + self.create_reservation, + default_timeout=300.0, + client_info=client_info, ), self.list_reservations: gapic_v1.method.wrap_method( self.list_reservations, @@ -174,7 +176,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_reservation: gapic_v1.method.wrap_method( - self.update_reservation, default_timeout=300.0, client_info=client_info, + self.update_reservation, + default_timeout=300.0, + client_info=client_info, ), self.create_capacity_commitment: gapic_v1.method.wrap_method( self.create_capacity_commitment, @@ -242,7 +246,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_assignment: gapic_v1.method.wrap_method( - self.create_assignment, default_timeout=300.0, client_info=client_info, + self.create_assignment, + default_timeout=300.0, + client_info=client_info, ), self.list_assignments: gapic_v1.method.wrap_method( self.list_assignments, @@ -295,7 +301,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.move_assignment: gapic_v1.method.wrap_method( - self.move_assignment, default_timeout=300.0, client_info=client_info, + self.move_assignment, + default_timeout=300.0, + client_info=client_info, ), self.get_bi_reservation: gapic_v1.method.wrap_method( self.get_bi_reservation, @@ -322,9 +330,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/grpc.py b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/grpc.py index b5ae1f578a50..32041b8a031e 100644 --- a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/grpc.py +++ b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/services/reservation_service/transports/grpc.py @@ -242,8 +242,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/types/reservation.py b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/types/reservation.py index e08655d34760..553eb8bb09a4 100644 --- a/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/types/reservation.py +++ b/packages/google-cloud-bigquery-reservation/google/cloud/bigquery_reservation_v1/types/reservation.py @@ -92,13 +92,28 @@ class Reservation(proto.Message): reservation. """ - name = proto.Field(proto.STRING, number=1,) - slot_capacity = proto.Field(proto.INT64, number=2,) - ignore_idle_slots = proto.Field(proto.BOOL, number=4,) + name = proto.Field( + proto.STRING, + number=1, + ) + slot_capacity = proto.Field( + proto.INT64, + number=2, + ) + ignore_idle_slots = proto.Field( + proto.BOOL, + number=4, + ) creation_time = proto.Field( - proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=9, + message=timestamp_pb2.Timestamp, ) - update_time = proto.Field(proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp,) class CapacityCommitment(proto.Message): @@ -162,18 +177,44 @@ class State(proto.Enum): ACTIVE = 2 FAILED = 3 - name = proto.Field(proto.STRING, number=1,) - slot_count = proto.Field(proto.INT64, number=2,) - plan = proto.Field(proto.ENUM, number=3, enum=CommitmentPlan,) - state = proto.Field(proto.ENUM, number=4, enum=State,) + name = proto.Field( + proto.STRING, + number=1, + ) + slot_count = proto.Field( + proto.INT64, + number=2, + ) + plan = proto.Field( + proto.ENUM, + number=3, + enum=CommitmentPlan, + ) + state = proto.Field( + proto.ENUM, + number=4, + enum=State, + ) commitment_start_time = proto.Field( - proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=9, + message=timestamp_pb2.Timestamp, ) commitment_end_time = proto.Field( - proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + failure_status = proto.Field( + proto.MESSAGE, + number=7, + message=status_pb2.Status, + ) + renewal_plan = proto.Field( + proto.ENUM, + number=8, + enum=CommitmentPlan, ) - failure_status = proto.Field(proto.MESSAGE, number=7, message=status_pb2.Status,) - renewal_plan = proto.Field(proto.ENUM, number=8, enum=CommitmentPlan,) class CreateReservationRequest(proto.Message): @@ -192,9 +233,19 @@ class CreateReservationRequest(proto.Message): Definition of the new reservation to create. """ - parent = proto.Field(proto.STRING, number=1,) - reservation_id = proto.Field(proto.STRING, number=2,) - reservation = proto.Field(proto.MESSAGE, number=3, message="Reservation",) + parent = proto.Field( + proto.STRING, + number=1, + ) + reservation_id = proto.Field( + proto.STRING, + number=2, + ) + reservation = proto.Field( + proto.MESSAGE, + number=3, + message="Reservation", + ) class ListReservationsRequest(proto.Message): @@ -213,9 +264,18 @@ class ListReservationsRequest(proto.Message): request, if any. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class ListReservationsResponse(proto.Message): @@ -235,8 +295,15 @@ class ListReservationsResponse(proto.Message): def raw_page(self): return self - reservations = proto.RepeatedField(proto.MESSAGE, number=1, message="Reservation",) - next_page_token = proto.Field(proto.STRING, number=2,) + reservations = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Reservation", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetReservationRequest(proto.Message): @@ -250,7 +317,10 @@ class GetReservationRequest(proto.Message): ``projects/myproject/locations/US/reservations/team1-prod`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class DeleteReservationRequest(proto.Message): @@ -264,7 +334,10 @@ class DeleteReservationRequest(proto.Message): ``projects/myproject/locations/US/reservations/team1-prod`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateReservationRequest(proto.Message): @@ -279,9 +352,15 @@ class UpdateReservationRequest(proto.Message): be updated. """ - reservation = proto.Field(proto.MESSAGE, number=1, message="Reservation",) + reservation = proto.Field( + proto.MESSAGE, + number=1, + message="Reservation", + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -308,12 +387,23 @@ class CreateCapacityCommitmentRequest(proto.Message): commitment is split or merged. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) capacity_commitment = proto.Field( - proto.MESSAGE, number=2, message="CapacityCommitment", + proto.MESSAGE, + number=2, + message="CapacityCommitment", + ) + enforce_single_admin_project_per_org = proto.Field( + proto.BOOL, + number=4, + ) + capacity_commitment_id = proto.Field( + proto.STRING, + number=5, ) - enforce_single_admin_project_per_org = proto.Field(proto.BOOL, number=4,) - capacity_commitment_id = proto.Field(proto.STRING, number=5,) class ListCapacityCommitmentsRequest(proto.Message): @@ -331,9 +421,18 @@ class ListCapacityCommitmentsRequest(proto.Message): request, if any. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class ListCapacityCommitmentsResponse(proto.Message): @@ -355,9 +454,14 @@ def raw_page(self): return self capacity_commitments = proto.RepeatedField( - proto.MESSAGE, number=1, message="CapacityCommitment", + proto.MESSAGE, + number=1, + message="CapacityCommitment", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, ) - next_page_token = proto.Field(proto.STRING, number=2,) class GetCapacityCommitmentRequest(proto.Message): @@ -371,7 +475,10 @@ class GetCapacityCommitmentRequest(proto.Message): ``projects/myproject/locations/US/capacityCommitments/123`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class DeleteCapacityCommitmentRequest(proto.Message): @@ -390,8 +497,14 @@ class DeleteCapacityCommitmentRequest(proto.Message): longer have access to slots. """ - name = proto.Field(proto.STRING, number=1,) - force = proto.Field(proto.BOOL, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + force = proto.Field( + proto.BOOL, + number=3, + ) class UpdateCapacityCommitmentRequest(proto.Message): @@ -407,10 +520,14 @@ class UpdateCapacityCommitmentRequest(proto.Message): """ capacity_commitment = proto.Field( - proto.MESSAGE, number=1, message="CapacityCommitment", + proto.MESSAGE, + number=1, + message="CapacityCommitment", ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -427,8 +544,14 @@ class SplitCapacityCommitmentRequest(proto.Message): after the split. """ - name = proto.Field(proto.STRING, number=1,) - slot_count = proto.Field(proto.INT64, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + slot_count = proto.Field( + proto.INT64, + number=2, + ) class SplitCapacityCommitmentResponse(proto.Message): @@ -443,8 +566,16 @@ class SplitCapacityCommitmentResponse(proto.Message): split. """ - first = proto.Field(proto.MESSAGE, number=1, message="CapacityCommitment",) - second = proto.Field(proto.MESSAGE, number=2, message="CapacityCommitment",) + first = proto.Field( + proto.MESSAGE, + number=1, + message="CapacityCommitment", + ) + second = proto.Field( + proto.MESSAGE, + number=2, + message="CapacityCommitment", + ) class MergeCapacityCommitmentsRequest(proto.Message): @@ -465,8 +596,14 @@ class MergeCapacityCommitmentsRequest(proto.Message): projects/myproject/locations/US/capacityCommitments/abc """ - parent = proto.Field(proto.STRING, number=1,) - capacity_commitment_ids = proto.RepeatedField(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + capacity_commitment_ids = proto.RepeatedField( + proto.STRING, + number=2, + ) class Assignment(proto.Message): @@ -505,10 +642,24 @@ class State(proto.Enum): PENDING = 1 ACTIVE = 2 - name = proto.Field(proto.STRING, number=1,) - assignee = proto.Field(proto.STRING, number=4,) - job_type = proto.Field(proto.ENUM, number=3, enum=JobType,) - state = proto.Field(proto.ENUM, number=6, enum=State,) + name = proto.Field( + proto.STRING, + number=1, + ) + assignee = proto.Field( + proto.STRING, + number=4, + ) + job_type = proto.Field( + proto.ENUM, + number=3, + enum=JobType, + ) + state = proto.Field( + proto.ENUM, + number=6, + enum=State, + ) class CreateAssignmentRequest(proto.Message): @@ -531,9 +682,19 @@ class CreateAssignmentRequest(proto.Message): 64 characters. """ - parent = proto.Field(proto.STRING, number=1,) - assignment = proto.Field(proto.MESSAGE, number=2, message="Assignment",) - assignment_id = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + assignment = proto.Field( + proto.MESSAGE, + number=2, + message="Assignment", + ) + assignment_id = proto.Field( + proto.STRING, + number=4, + ) class ListAssignmentsRequest(proto.Message): @@ -557,9 +718,18 @@ class ListAssignmentsRequest(proto.Message): request, if any. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class ListAssignmentsResponse(proto.Message): @@ -579,8 +749,15 @@ class ListAssignmentsResponse(proto.Message): def raw_page(self): return self - assignments = proto.RepeatedField(proto.MESSAGE, number=1, message="Assignment",) - next_page_token = proto.Field(proto.STRING, number=2,) + assignments = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Assignment", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class DeleteAssignmentRequest(proto.Message): @@ -595,7 +772,10 @@ class DeleteAssignmentRequest(proto.Message): ``projects/myproject/locations/US/reservations/team1-prod/assignments/123`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class SearchAssignmentsRequest(proto.Message): @@ -625,10 +805,22 @@ class SearchAssignmentsRequest(proto.Message): request, if any. """ - parent = proto.Field(proto.STRING, number=1,) - query = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + query = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) class SearchAllAssignmentsRequest(proto.Message): @@ -658,10 +850,22 @@ class SearchAllAssignmentsRequest(proto.Message): request, if any. """ - parent = proto.Field(proto.STRING, number=1,) - query = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + query = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) class SearchAssignmentsResponse(proto.Message): @@ -681,8 +885,15 @@ class SearchAssignmentsResponse(proto.Message): def raw_page(self): return self - assignments = proto.RepeatedField(proto.MESSAGE, number=1, message="Assignment",) - next_page_token = proto.Field(proto.STRING, number=2,) + assignments = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Assignment", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class SearchAllAssignmentsResponse(proto.Message): @@ -702,8 +913,15 @@ class SearchAllAssignmentsResponse(proto.Message): def raw_page(self): return self - assignments = proto.RepeatedField(proto.MESSAGE, number=1, message="Assignment",) - next_page_token = proto.Field(proto.STRING, number=2,) + assignments = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Assignment", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class MoveAssignmentRequest(proto.Message): @@ -726,8 +944,14 @@ class MoveAssignmentRequest(proto.Message): ``projects/myotherproject/locations/US/reservations/team2-prod`` """ - name = proto.Field(proto.STRING, number=1,) - destination_id = proto.Field(proto.STRING, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + destination_id = proto.Field( + proto.STRING, + number=3, + ) class BiReservation(proto.Message): @@ -745,9 +969,19 @@ class BiReservation(proto.Message): Size of a reservation, in bytes. """ - name = proto.Field(proto.STRING, number=1,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - size = proto.Field(proto.INT64, number=4,) + name = proto.Field( + proto.STRING, + number=1, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + size = proto.Field( + proto.INT64, + number=4, + ) class GetBiReservationRequest(proto.Message): @@ -759,7 +993,10 @@ class GetBiReservationRequest(proto.Message): ``projects/{project_id}/locations/{location_id}/biReservation`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateBiReservationRequest(proto.Message): @@ -773,9 +1010,15 @@ class UpdateBiReservationRequest(proto.Message): request. """ - bi_reservation = proto.Field(proto.MESSAGE, number=1, message="BiReservation",) + bi_reservation = proto.Field( + proto.MESSAGE, + number=1, + message="BiReservation", + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) diff --git a/packages/google-cloud-bigquery-reservation/noxfile.py b/packages/google-cloud-bigquery-reservation/noxfile.py index 2a2001c49998..3addb4ed9431 100644 --- a/packages/google-cloud-bigquery-reservation/noxfile.py +++ b/packages/google-cloud-bigquery-reservation/noxfile.py @@ -24,7 +24,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -57,7 +57,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +69,8 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) diff --git a/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py b/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py index 85f5836dba3a..25f87a215d4c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py +++ b/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_create.py b/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_create.py index 67955606f2ab..bae295e880c6 100644 --- a/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_create.py +++ b/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_create.py @@ -58,7 +58,9 @@ def create_reservation( reservation = reservation_types.Reservation(slot_capacity=slot_capacity) reservation = reservation_client.create_reservation( - parent=parent, reservation=reservation, reservation_id=reservation_id, + parent=parent, + reservation=reservation, + reservation_id=reservation_id, ) print(f"Created reservation: {reservation.name}") diff --git a/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_update.py b/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_update.py index 93a9cf53139c..d43a96dc7b32 100644 --- a/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_update.py +++ b/packages/google-cloud-bigquery-reservation/samples/snippets/reservation_update.py @@ -59,7 +59,8 @@ def update_reservation( project_id, location, reservation_id ) reservation = reservation_types.Reservation( - name=reservation_name, slot_capacity=slot_capacity, + name=reservation_name, + slot_capacity=slot_capacity, ) field_mask = field_mask_pb2.FieldMask(paths=["slot_capacity"]) reservation = reservation_client.update_reservation( diff --git a/packages/google-cloud-bigquery-reservation/tests/unit/gapic/bigquery_reservation_v1/test_reservation_service.py b/packages/google-cloud-bigquery-reservation/tests/unit/gapic/bigquery_reservation_v1/test_reservation_service.py index c2bca66a29b0..500cced3d381 100644 --- a/packages/google-cloud-bigquery-reservation/tests/unit/gapic/bigquery_reservation_v1/test_reservation_service.py +++ b/packages/google-cloud-bigquery-reservation/tests/unit/gapic/bigquery_reservation_v1/test_reservation_service.py @@ -95,7 +95,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [ReservationServiceClient, ReservationServiceAsyncClient,] + "client_class", + [ + ReservationServiceClient, + ReservationServiceAsyncClient, + ], ) def test_reservation_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -137,7 +141,11 @@ def test_reservation_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [ReservationServiceClient, ReservationServiceAsyncClient,] + "client_class", + [ + ReservationServiceClient, + ReservationServiceAsyncClient, + ], ) def test_reservation_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -511,7 +519,9 @@ def test_reservation_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -655,11 +665,16 @@ def test_reservation_service_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [gcbr_reservation.CreateReservationRequest, dict,] + "request_type", + [ + gcbr_reservation.CreateReservationRequest, + dict, + ], ) def test_create_reservation(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -672,7 +687,9 @@ def test_create_reservation(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = gcbr_reservation.Reservation( - name="name_value", slot_capacity=1391, ignore_idle_slots=True, + name="name_value", + slot_capacity=1391, + ignore_idle_slots=True, ) response = client.create_reservation(request) @@ -692,7 +709,8 @@ def test_create_reservation_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -711,7 +729,8 @@ async def test_create_reservation_async( request_type=gcbr_reservation.CreateReservationRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -725,7 +744,9 @@ async def test_create_reservation_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( gcbr_reservation.Reservation( - name="name_value", slot_capacity=1391, ignore_idle_slots=True, + name="name_value", + slot_capacity=1391, + ignore_idle_slots=True, ) ) response = await client.create_reservation(request) @@ -772,7 +793,10 @@ def test_create_reservation_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -803,7 +827,10 @@ async def test_create_reservation_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_reservation_flattened(): @@ -912,10 +939,17 @@ async def test_create_reservation_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [reservation.ListReservationsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.ListReservationsRequest, + dict, + ], +) def test_list_reservations(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -946,7 +980,8 @@ def test_list_reservations_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -964,7 +999,8 @@ async def test_list_reservations_async( transport: str = "grpc_asyncio", request_type=reservation.ListReservationsRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1023,7 +1059,10 @@ def test_list_reservations_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1054,7 +1093,10 @@ async def test_list_reservations_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_reservations_flattened(): @@ -1070,7 +1112,9 @@ def test_list_reservations_flattened(): call.return_value = reservation.ListReservationsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_reservations(parent="parent_value",) + client.list_reservations( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1090,7 +1134,8 @@ def test_list_reservations_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.list_reservations( - reservation.ListReservationsRequest(), parent="parent_value", + reservation.ListReservationsRequest(), + parent="parent_value", ) @@ -1112,7 +1157,9 @@ async def test_list_reservations_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_reservations(parent="parent_value",) + response = await client.list_reservations( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1133,13 +1180,15 @@ async def test_list_reservations_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_reservations( - reservation.ListReservationsRequest(), parent="parent_value", + reservation.ListReservationsRequest(), + parent="parent_value", ) def test_list_reservations_pager(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1157,13 +1206,20 @@ def test_list_reservations_pager(transport_name: str = "grpc"): next_page_token="abc", ), reservation.ListReservationsResponse( - reservations=[], next_page_token="def", + reservations=[], + next_page_token="def", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(),], next_page_token="ghi", + reservations=[ + reservation.Reservation(), + ], + next_page_token="ghi", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(), reservation.Reservation(),], + reservations=[ + reservation.Reservation(), + reservation.Reservation(), + ], ), RuntimeError, ) @@ -1183,7 +1239,8 @@ def test_list_reservations_pager(transport_name: str = "grpc"): def test_list_reservations_pages(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1201,13 +1258,20 @@ def test_list_reservations_pages(transport_name: str = "grpc"): next_page_token="abc", ), reservation.ListReservationsResponse( - reservations=[], next_page_token="def", + reservations=[], + next_page_token="def", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(),], next_page_token="ghi", + reservations=[ + reservation.Reservation(), + ], + next_page_token="ghi", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(), reservation.Reservation(),], + reservations=[ + reservation.Reservation(), + reservation.Reservation(), + ], ), RuntimeError, ) @@ -1239,17 +1303,26 @@ async def test_list_reservations_async_pager(): next_page_token="abc", ), reservation.ListReservationsResponse( - reservations=[], next_page_token="def", + reservations=[], + next_page_token="def", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(),], next_page_token="ghi", + reservations=[ + reservation.Reservation(), + ], + next_page_token="ghi", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(), reservation.Reservation(),], + reservations=[ + reservation.Reservation(), + reservation.Reservation(), + ], ), RuntimeError, ) - async_pager = await client.list_reservations(request={},) + async_pager = await client.list_reservations( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1282,13 +1355,20 @@ async def test_list_reservations_async_pages(): next_page_token="abc", ), reservation.ListReservationsResponse( - reservations=[], next_page_token="def", + reservations=[], + next_page_token="def", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(),], next_page_token="ghi", + reservations=[ + reservation.Reservation(), + ], + next_page_token="ghi", ), reservation.ListReservationsResponse( - reservations=[reservation.Reservation(), reservation.Reservation(),], + reservations=[ + reservation.Reservation(), + reservation.Reservation(), + ], ), RuntimeError, ) @@ -1299,10 +1379,17 @@ async def test_list_reservations_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [reservation.GetReservationRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.GetReservationRequest, + dict, + ], +) def test_get_reservation(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1313,7 +1400,9 @@ def test_get_reservation(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.get_reservation), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = reservation.Reservation( - name="name_value", slot_capacity=1391, ignore_idle_slots=True, + name="name_value", + slot_capacity=1391, + ignore_idle_slots=True, ) response = client.get_reservation(request) @@ -1333,7 +1422,8 @@ def test_get_reservation_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1349,7 +1439,8 @@ async def test_get_reservation_async( transport: str = "grpc_asyncio", request_type=reservation.GetReservationRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1361,7 +1452,9 @@ async def test_get_reservation_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( reservation.Reservation( - name="name_value", slot_capacity=1391, ignore_idle_slots=True, + name="name_value", + slot_capacity=1391, + ignore_idle_slots=True, ) ) response = await client.get_reservation(request) @@ -1406,7 +1499,10 @@ def test_get_reservation_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1435,7 +1531,10 @@ async def test_get_reservation_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_reservation_flattened(): @@ -1449,7 +1548,9 @@ def test_get_reservation_flattened(): call.return_value = reservation.Reservation() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_reservation(name="name_value",) + client.get_reservation( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1469,7 +1570,8 @@ def test_get_reservation_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.get_reservation( - reservation.GetReservationRequest(), name="name_value", + reservation.GetReservationRequest(), + name="name_value", ) @@ -1489,7 +1591,9 @@ async def test_get_reservation_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_reservation(name="name_value",) + response = await client.get_reservation( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1510,14 +1614,22 @@ async def test_get_reservation_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_reservation( - reservation.GetReservationRequest(), name="name_value", + reservation.GetReservationRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [reservation.DeleteReservationRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.DeleteReservationRequest, + dict, + ], +) def test_delete_reservation(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1545,7 +1657,8 @@ def test_delete_reservation_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1563,7 +1676,8 @@ async def test_delete_reservation_async( transport: str = "grpc_asyncio", request_type=reservation.DeleteReservationRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1617,7 +1731,10 @@ def test_delete_reservation_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1646,7 +1763,10 @@ async def test_delete_reservation_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_reservation_flattened(): @@ -1662,7 +1782,9 @@ def test_delete_reservation_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_reservation(name="name_value",) + client.delete_reservation( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1682,7 +1804,8 @@ def test_delete_reservation_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.delete_reservation( - reservation.DeleteReservationRequest(), name="name_value", + reservation.DeleteReservationRequest(), + name="name_value", ) @@ -1702,7 +1825,9 @@ async def test_delete_reservation_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_reservation(name="name_value",) + response = await client.delete_reservation( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1723,16 +1848,22 @@ async def test_delete_reservation_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_reservation( - reservation.DeleteReservationRequest(), name="name_value", + reservation.DeleteReservationRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [gcbr_reservation.UpdateReservationRequest, dict,] + "request_type", + [ + gcbr_reservation.UpdateReservationRequest, + dict, + ], ) def test_update_reservation(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1745,7 +1876,9 @@ def test_update_reservation(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = gcbr_reservation.Reservation( - name="name_value", slot_capacity=1391, ignore_idle_slots=True, + name="name_value", + slot_capacity=1391, + ignore_idle_slots=True, ) response = client.update_reservation(request) @@ -1765,7 +1898,8 @@ def test_update_reservation_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1784,7 +1918,8 @@ async def test_update_reservation_async( request_type=gcbr_reservation.UpdateReservationRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1798,7 +1933,9 @@ async def test_update_reservation_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( gcbr_reservation.Reservation( - name="name_value", slot_capacity=1391, ignore_idle_slots=True, + name="name_value", + slot_capacity=1391, + ignore_idle_slots=True, ) ) response = await client.update_reservation(request) @@ -1845,9 +1982,10 @@ def test_update_reservation_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "reservation.name=reservation.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "reservation.name=reservation.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1878,9 +2016,10 @@ async def test_update_reservation_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "reservation.name=reservation.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "reservation.name=reservation.name/value", + ) in kw["metadata"] def test_update_reservation_flattened(): @@ -1980,11 +2119,16 @@ async def test_update_reservation_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [reservation.CreateCapacityCommitmentRequest, dict,] + "request_type", + [ + reservation.CreateCapacityCommitmentRequest, + dict, + ], ) def test_create_capacity_commitment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2023,7 +2167,8 @@ def test_create_capacity_commitment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2042,7 +2187,8 @@ async def test_create_capacity_commitment_async( request_type=reservation.CreateCapacityCommitmentRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2109,7 +2255,10 @@ def test_create_capacity_commitment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2140,7 +2289,10 @@ async def test_create_capacity_commitment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_capacity_commitment_flattened(): @@ -2240,11 +2392,16 @@ async def test_create_capacity_commitment_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [reservation.ListCapacityCommitmentsRequest, dict,] + "request_type", + [ + reservation.ListCapacityCommitmentsRequest, + dict, + ], ) def test_list_capacity_commitments(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2275,7 +2432,8 @@ def test_list_capacity_commitments_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2294,7 +2452,8 @@ async def test_list_capacity_commitments_async( request_type=reservation.ListCapacityCommitmentsRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2353,7 +2512,10 @@ def test_list_capacity_commitments_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2384,7 +2546,10 @@ async def test_list_capacity_commitments_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_capacity_commitments_flattened(): @@ -2400,7 +2565,9 @@ def test_list_capacity_commitments_flattened(): call.return_value = reservation.ListCapacityCommitmentsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_capacity_commitments(parent="parent_value",) + client.list_capacity_commitments( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2420,7 +2587,8 @@ def test_list_capacity_commitments_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.list_capacity_commitments( - reservation.ListCapacityCommitmentsRequest(), parent="parent_value", + reservation.ListCapacityCommitmentsRequest(), + parent="parent_value", ) @@ -2442,7 +2610,9 @@ async def test_list_capacity_commitments_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_capacity_commitments(parent="parent_value",) + response = await client.list_capacity_commitments( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2463,13 +2633,15 @@ async def test_list_capacity_commitments_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_capacity_commitments( - reservation.ListCapacityCommitmentsRequest(), parent="parent_value", + reservation.ListCapacityCommitmentsRequest(), + parent="parent_value", ) def test_list_capacity_commitments_pager(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2487,10 +2659,13 @@ def test_list_capacity_commitments_pager(transport_name: str = "grpc"): next_page_token="abc", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[], next_page_token="def", + capacity_commitments=[], + next_page_token="def", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[reservation.CapacityCommitment(),], + capacity_commitments=[ + reservation.CapacityCommitment(), + ], next_page_token="ghi", ), reservation.ListCapacityCommitmentsResponse( @@ -2517,7 +2692,8 @@ def test_list_capacity_commitments_pager(transport_name: str = "grpc"): def test_list_capacity_commitments_pages(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2535,10 +2711,13 @@ def test_list_capacity_commitments_pages(transport_name: str = "grpc"): next_page_token="abc", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[], next_page_token="def", + capacity_commitments=[], + next_page_token="def", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[reservation.CapacityCommitment(),], + capacity_commitments=[ + reservation.CapacityCommitment(), + ], next_page_token="ghi", ), reservation.ListCapacityCommitmentsResponse( @@ -2577,10 +2756,13 @@ async def test_list_capacity_commitments_async_pager(): next_page_token="abc", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[], next_page_token="def", + capacity_commitments=[], + next_page_token="def", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[reservation.CapacityCommitment(),], + capacity_commitments=[ + reservation.CapacityCommitment(), + ], next_page_token="ghi", ), reservation.ListCapacityCommitmentsResponse( @@ -2591,7 +2773,9 @@ async def test_list_capacity_commitments_async_pager(): ), RuntimeError, ) - async_pager = await client.list_capacity_commitments(request={},) + async_pager = await client.list_capacity_commitments( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2624,10 +2808,13 @@ async def test_list_capacity_commitments_async_pages(): next_page_token="abc", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[], next_page_token="def", + capacity_commitments=[], + next_page_token="def", ), reservation.ListCapacityCommitmentsResponse( - capacity_commitments=[reservation.CapacityCommitment(),], + capacity_commitments=[ + reservation.CapacityCommitment(), + ], next_page_token="ghi", ), reservation.ListCapacityCommitmentsResponse( @@ -2646,11 +2833,16 @@ async def test_list_capacity_commitments_async_pages(): @pytest.mark.parametrize( - "request_type", [reservation.GetCapacityCommitmentRequest, dict,] + "request_type", + [ + reservation.GetCapacityCommitmentRequest, + dict, + ], ) def test_get_capacity_commitment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2689,7 +2881,8 @@ def test_get_capacity_commitment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2708,7 +2901,8 @@ async def test_get_capacity_commitment_async( request_type=reservation.GetCapacityCommitmentRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2775,7 +2969,10 @@ def test_get_capacity_commitment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2806,7 +3003,10 @@ async def test_get_capacity_commitment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_capacity_commitment_flattened(): @@ -2822,7 +3022,9 @@ def test_get_capacity_commitment_flattened(): call.return_value = reservation.CapacityCommitment() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_capacity_commitment(name="name_value",) + client.get_capacity_commitment( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2842,7 +3044,8 @@ def test_get_capacity_commitment_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.get_capacity_commitment( - reservation.GetCapacityCommitmentRequest(), name="name_value", + reservation.GetCapacityCommitmentRequest(), + name="name_value", ) @@ -2864,7 +3067,9 @@ async def test_get_capacity_commitment_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_capacity_commitment(name="name_value",) + response = await client.get_capacity_commitment( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2885,16 +3090,22 @@ async def test_get_capacity_commitment_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_capacity_commitment( - reservation.GetCapacityCommitmentRequest(), name="name_value", + reservation.GetCapacityCommitmentRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [reservation.DeleteCapacityCommitmentRequest, dict,] + "request_type", + [ + reservation.DeleteCapacityCommitmentRequest, + dict, + ], ) def test_delete_capacity_commitment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2922,7 +3133,8 @@ def test_delete_capacity_commitment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2941,7 +3153,8 @@ async def test_delete_capacity_commitment_async( request_type=reservation.DeleteCapacityCommitmentRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2995,7 +3208,10 @@ def test_delete_capacity_commitment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3024,7 +3240,10 @@ async def test_delete_capacity_commitment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_capacity_commitment_flattened(): @@ -3040,7 +3259,9 @@ def test_delete_capacity_commitment_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_capacity_commitment(name="name_value",) + client.delete_capacity_commitment( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3060,7 +3281,8 @@ def test_delete_capacity_commitment_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.delete_capacity_commitment( - reservation.DeleteCapacityCommitmentRequest(), name="name_value", + reservation.DeleteCapacityCommitmentRequest(), + name="name_value", ) @@ -3080,7 +3302,9 @@ async def test_delete_capacity_commitment_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_capacity_commitment(name="name_value",) + response = await client.delete_capacity_commitment( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3101,16 +3325,22 @@ async def test_delete_capacity_commitment_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_capacity_commitment( - reservation.DeleteCapacityCommitmentRequest(), name="name_value", + reservation.DeleteCapacityCommitmentRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [reservation.UpdateCapacityCommitmentRequest, dict,] + "request_type", + [ + reservation.UpdateCapacityCommitmentRequest, + dict, + ], ) def test_update_capacity_commitment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3149,7 +3379,8 @@ def test_update_capacity_commitment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3168,7 +3399,8 @@ async def test_update_capacity_commitment_async( request_type=reservation.UpdateCapacityCommitmentRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3372,11 +3604,16 @@ async def test_update_capacity_commitment_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [reservation.SplitCapacityCommitmentRequest, dict,] + "request_type", + [ + reservation.SplitCapacityCommitmentRequest, + dict, + ], ) def test_split_capacity_commitment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3404,7 +3641,8 @@ def test_split_capacity_commitment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3423,7 +3661,8 @@ async def test_split_capacity_commitment_async( request_type=reservation.SplitCapacityCommitmentRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3479,7 +3718,10 @@ def test_split_capacity_commitment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3510,7 +3752,10 @@ async def test_split_capacity_commitment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_split_capacity_commitment_flattened(): @@ -3527,7 +3772,8 @@ def test_split_capacity_commitment_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.split_capacity_commitment( - name="name_value", slot_count=1098, + name="name_value", + slot_count=1098, ) # Establish that the underlying call was made with the expected @@ -3576,7 +3822,8 @@ async def test_split_capacity_commitment_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.split_capacity_commitment( - name="name_value", slot_count=1098, + name="name_value", + slot_count=1098, ) # Establish that the underlying call was made with the expected @@ -3608,11 +3855,16 @@ async def test_split_capacity_commitment_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [reservation.MergeCapacityCommitmentsRequest, dict,] + "request_type", + [ + reservation.MergeCapacityCommitmentsRequest, + dict, + ], ) def test_merge_capacity_commitments(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3651,7 +3903,8 @@ def test_merge_capacity_commitments_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3670,7 +3923,8 @@ async def test_merge_capacity_commitments_async( request_type=reservation.MergeCapacityCommitmentsRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3737,7 +3991,10 @@ def test_merge_capacity_commitments_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3768,7 +4025,10 @@ async def test_merge_capacity_commitments_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_merge_capacity_commitments_flattened(): @@ -3867,10 +4127,17 @@ async def test_merge_capacity_commitments_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [reservation.CreateAssignmentRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.CreateAssignmentRequest, + dict, + ], +) def test_create_assignment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3907,7 +4174,8 @@ def test_create_assignment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3925,7 +4193,8 @@ async def test_create_assignment_async( transport: str = "grpc_asyncio", request_type=reservation.CreateAssignmentRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3990,7 +4259,10 @@ def test_create_assignment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -4021,7 +4293,10 @@ async def test_create_assignment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_assignment_flattened(): @@ -4038,7 +4313,8 @@ def test_create_assignment_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_assignment( - parent="parent_value", assignment=reservation.Assignment(name="name_value"), + parent="parent_value", + assignment=reservation.Assignment(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -4087,7 +4363,8 @@ async def test_create_assignment_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_assignment( - parent="parent_value", assignment=reservation.Assignment(name="name_value"), + parent="parent_value", + assignment=reservation.Assignment(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -4118,10 +4395,17 @@ async def test_create_assignment_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [reservation.ListAssignmentsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.ListAssignmentsRequest, + dict, + ], +) def test_list_assignments(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4150,7 +4434,8 @@ def test_list_assignments_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4166,7 +4451,8 @@ async def test_list_assignments_async( transport: str = "grpc_asyncio", request_type=reservation.ListAssignmentsRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4221,7 +4507,10 @@ def test_list_assignments_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -4250,7 +4539,10 @@ async def test_list_assignments_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_assignments_flattened(): @@ -4264,7 +4556,9 @@ def test_list_assignments_flattened(): call.return_value = reservation.ListAssignmentsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_assignments(parent="parent_value",) + client.list_assignments( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4284,7 +4578,8 @@ def test_list_assignments_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.list_assignments( - reservation.ListAssignmentsRequest(), parent="parent_value", + reservation.ListAssignmentsRequest(), + parent="parent_value", ) @@ -4304,7 +4599,9 @@ async def test_list_assignments_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_assignments(parent="parent_value",) + response = await client.list_assignments( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4325,13 +4622,15 @@ async def test_list_assignments_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_assignments( - reservation.ListAssignmentsRequest(), parent="parent_value", + reservation.ListAssignmentsRequest(), + parent="parent_value", ) def test_list_assignments_pager(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4346,12 +4645,21 @@ def test_list_assignments_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - reservation.ListAssignmentsResponse(assignments=[], next_page_token="def",), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[], + next_page_token="def", + ), + reservation.ListAssignmentsResponse( + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -4371,7 +4679,8 @@ def test_list_assignments_pager(transport_name: str = "grpc"): def test_list_assignments_pages(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4386,12 +4695,21 @@ def test_list_assignments_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - reservation.ListAssignmentsResponse(assignments=[], next_page_token="def",), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[], + next_page_token="def", ), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", + ), + reservation.ListAssignmentsResponse( + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -4420,16 +4738,27 @@ async def test_list_assignments_async_pager(): ], next_page_token="abc", ), - reservation.ListAssignmentsResponse(assignments=[], next_page_token="def",), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[], + next_page_token="def", ), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", + ), + reservation.ListAssignmentsResponse( + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) - async_pager = await client.list_assignments(request={},) + async_pager = await client.list_assignments( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -4459,12 +4788,21 @@ async def test_list_assignments_async_pages(): ], next_page_token="abc", ), - reservation.ListAssignmentsResponse(assignments=[], next_page_token="def",), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[], + next_page_token="def", + ), + reservation.ListAssignmentsResponse( + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.ListAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -4475,10 +4813,17 @@ async def test_list_assignments_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [reservation.DeleteAssignmentRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.DeleteAssignmentRequest, + dict, + ], +) def test_delete_assignment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4506,7 +4851,8 @@ def test_delete_assignment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4524,7 +4870,8 @@ async def test_delete_assignment_async( transport: str = "grpc_asyncio", request_type=reservation.DeleteAssignmentRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4578,7 +4925,10 @@ def test_delete_assignment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -4607,7 +4957,10 @@ async def test_delete_assignment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_assignment_flattened(): @@ -4623,7 +4976,9 @@ def test_delete_assignment_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_assignment(name="name_value",) + client.delete_assignment( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4643,7 +4998,8 @@ def test_delete_assignment_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.delete_assignment( - reservation.DeleteAssignmentRequest(), name="name_value", + reservation.DeleteAssignmentRequest(), + name="name_value", ) @@ -4663,7 +5019,9 @@ async def test_delete_assignment_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_assignment(name="name_value",) + response = await client.delete_assignment( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4684,14 +5042,22 @@ async def test_delete_assignment_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_assignment( - reservation.DeleteAssignmentRequest(), name="name_value", + reservation.DeleteAssignmentRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [reservation.SearchAssignmentsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.SearchAssignmentsRequest, + dict, + ], +) def test_search_assignments(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4722,7 +5088,8 @@ def test_search_assignments_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4740,7 +5107,8 @@ async def test_search_assignments_async( transport: str = "grpc_asyncio", request_type=reservation.SearchAssignmentsRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4799,7 +5167,10 @@ def test_search_assignments_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -4830,7 +5201,10 @@ async def test_search_assignments_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_search_assignments_flattened(): @@ -4847,7 +5221,8 @@ def test_search_assignments_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.search_assignments( - parent="parent_value", query="query_value", + parent="parent_value", + query="query_value", ) # Establish that the underlying call was made with the expected @@ -4896,7 +5271,8 @@ async def test_search_assignments_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.search_assignments( - parent="parent_value", query="query_value", + parent="parent_value", + query="query_value", ) # Establish that the underlying call was made with the expected @@ -4929,7 +5305,8 @@ async def test_search_assignments_flattened_error_async(): def test_search_assignments_pager(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4947,13 +5324,20 @@ def test_search_assignments_pager(transport_name: str = "grpc"): next_page_token="abc", ), reservation.SearchAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -4973,7 +5357,8 @@ def test_search_assignments_pager(transport_name: str = "grpc"): def test_search_assignments_pages(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4991,13 +5376,20 @@ def test_search_assignments_pages(transport_name: str = "grpc"): next_page_token="abc", ), reservation.SearchAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -5029,17 +5421,26 @@ async def test_search_assignments_async_pager(): next_page_token="abc", ), reservation.SearchAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) - async_pager = await client.search_assignments(request={},) + async_pager = await client.search_assignments( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -5072,13 +5473,20 @@ async def test_search_assignments_async_pages(): next_page_token="abc", ), reservation.SearchAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -5090,11 +5498,16 @@ async def test_search_assignments_async_pages(): @pytest.mark.parametrize( - "request_type", [reservation.SearchAllAssignmentsRequest, dict,] + "request_type", + [ + reservation.SearchAllAssignmentsRequest, + dict, + ], ) def test_search_all_assignments(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5125,7 +5538,8 @@ def test_search_all_assignments_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5144,7 +5558,8 @@ async def test_search_all_assignments_async( request_type=reservation.SearchAllAssignmentsRequest, ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5203,7 +5618,10 @@ def test_search_all_assignments_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -5234,7 +5652,10 @@ async def test_search_all_assignments_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_search_all_assignments_flattened(): @@ -5251,7 +5672,8 @@ def test_search_all_assignments_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.search_all_assignments( - parent="parent_value", query="query_value", + parent="parent_value", + query="query_value", ) # Establish that the underlying call was made with the expected @@ -5300,7 +5722,8 @@ async def test_search_all_assignments_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.search_all_assignments( - parent="parent_value", query="query_value", + parent="parent_value", + query="query_value", ) # Establish that the underlying call was made with the expected @@ -5333,7 +5756,8 @@ async def test_search_all_assignments_flattened_error_async(): def test_search_all_assignments_pager(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5351,13 +5775,20 @@ def test_search_all_assignments_pager(transport_name: str = "grpc"): next_page_token="abc", ), reservation.SearchAllAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -5377,7 +5808,8 @@ def test_search_all_assignments_pager(transport_name: str = "grpc"): def test_search_all_assignments_pages(transport_name: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5395,13 +5827,20 @@ def test_search_all_assignments_pages(transport_name: str = "grpc"): next_page_token="abc", ), reservation.SearchAllAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -5433,17 +5872,26 @@ async def test_search_all_assignments_async_pager(): next_page_token="abc", ), reservation.SearchAllAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) - async_pager = await client.search_all_assignments(request={},) + async_pager = await client.search_all_assignments( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -5476,13 +5924,20 @@ async def test_search_all_assignments_async_pages(): next_page_token="abc", ), reservation.SearchAllAssignmentsResponse( - assignments=[], next_page_token="def", + assignments=[], + next_page_token="def", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(),], next_page_token="ghi", + assignments=[ + reservation.Assignment(), + ], + next_page_token="ghi", ), reservation.SearchAllAssignmentsResponse( - assignments=[reservation.Assignment(), reservation.Assignment(),], + assignments=[ + reservation.Assignment(), + reservation.Assignment(), + ], ), RuntimeError, ) @@ -5493,10 +5948,17 @@ async def test_search_all_assignments_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [reservation.MoveAssignmentRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.MoveAssignmentRequest, + dict, + ], +) def test_move_assignment(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5531,7 +5993,8 @@ def test_move_assignment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5547,7 +6010,8 @@ async def test_move_assignment_async( transport: str = "grpc_asyncio", request_type=reservation.MoveAssignmentRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5608,7 +6072,10 @@ def test_move_assignment_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -5637,7 +6104,10 @@ async def test_move_assignment_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_move_assignment_flattened(): @@ -5652,7 +6122,8 @@ def test_move_assignment_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.move_assignment( - name="name_value", destination_id="destination_id_value", + name="name_value", + destination_id="destination_id_value", ) # Establish that the underlying call was made with the expected @@ -5699,7 +6170,8 @@ async def test_move_assignment_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.move_assignment( - name="name_value", destination_id="destination_id_value", + name="name_value", + destination_id="destination_id_value", ) # Establish that the underlying call was made with the expected @@ -5730,10 +6202,17 @@ async def test_move_assignment_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [reservation.GetBiReservationRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + reservation.GetBiReservationRequest, + dict, + ], +) def test_get_bi_reservation(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5745,7 +6224,10 @@ def test_get_bi_reservation(request_type, transport: str = "grpc"): type(client.transport.get_bi_reservation), "__call__" ) as call: # Designate an appropriate return value for the call. - call.return_value = reservation.BiReservation(name="name_value", size=443,) + call.return_value = reservation.BiReservation( + name="name_value", + size=443, + ) response = client.get_bi_reservation(request) # Establish that the underlying gRPC stub method was called. @@ -5763,7 +6245,8 @@ def test_get_bi_reservation_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5781,7 +6264,8 @@ async def test_get_bi_reservation_async( transport: str = "grpc_asyncio", request_type=reservation.GetBiReservationRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5794,7 +6278,10 @@ async def test_get_bi_reservation_async( ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - reservation.BiReservation(name="name_value", size=443,) + reservation.BiReservation( + name="name_value", + size=443, + ) ) response = await client.get_bi_reservation(request) @@ -5839,7 +6326,10 @@ def test_get_bi_reservation_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -5870,7 +6360,10 @@ async def test_get_bi_reservation_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_bi_reservation_flattened(): @@ -5886,7 +6379,9 @@ def test_get_bi_reservation_flattened(): call.return_value = reservation.BiReservation() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_bi_reservation(name="name_value",) + client.get_bi_reservation( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5906,7 +6401,8 @@ def test_get_bi_reservation_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.get_bi_reservation( - reservation.GetBiReservationRequest(), name="name_value", + reservation.GetBiReservationRequest(), + name="name_value", ) @@ -5928,7 +6424,9 @@ async def test_get_bi_reservation_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_bi_reservation(name="name_value",) + response = await client.get_bi_reservation( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5949,16 +6447,22 @@ async def test_get_bi_reservation_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_bi_reservation( - reservation.GetBiReservationRequest(), name="name_value", + reservation.GetBiReservationRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [reservation.UpdateBiReservationRequest, dict,] + "request_type", + [ + reservation.UpdateBiReservationRequest, + dict, + ], ) def test_update_bi_reservation(request_type, transport: str = "grpc"): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5970,7 +6474,10 @@ def test_update_bi_reservation(request_type, transport: str = "grpc"): type(client.transport.update_bi_reservation), "__call__" ) as call: # Designate an appropriate return value for the call. - call.return_value = reservation.BiReservation(name="name_value", size=443,) + call.return_value = reservation.BiReservation( + name="name_value", + size=443, + ) response = client.update_bi_reservation(request) # Establish that the underlying gRPC stub method was called. @@ -5988,7 +6495,8 @@ def test_update_bi_reservation_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6006,7 +6514,8 @@ async def test_update_bi_reservation_async( transport: str = "grpc_asyncio", request_type=reservation.UpdateBiReservationRequest ): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6019,7 +6528,10 @@ async def test_update_bi_reservation_async( ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - reservation.BiReservation(name="name_value", size=443,) + reservation.BiReservation( + name="name_value", + size=443, + ) ) response = await client.update_bi_reservation(request) @@ -6207,7 +6719,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -6227,7 +6740,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = ReservationServiceClient(client_options=options, transport=transport,) + client = ReservationServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -6243,7 +6759,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ReservationServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -6291,7 +6808,10 @@ def test_transport_grpc_default(): client = ReservationServiceClient( credentials=ga_credentials.AnonymousCredentials(), ) - assert isinstance(client.transport, transports.ReservationServiceGrpcTransport,) + assert isinstance( + client.transport, + transports.ReservationServiceGrpcTransport, + ) def test_reservation_service_base_transport_error(): @@ -6355,7 +6875,8 @@ def test_reservation_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ReservationServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -6527,7 +7048,8 @@ def test_reservation_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.ReservationServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -6539,7 +7061,8 @@ def test_reservation_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.ReservationServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -6681,7 +7204,8 @@ def test_bi_reservation_path(): project = "winkle" location = "nautilus" expected = "projects/{project}/locations/{location}/biReservation".format( - project=project, location=location, + project=project, + location=location, ) actual = ReservationServiceClient.bi_reservation_path(project, location) assert expected == actual @@ -6704,7 +7228,9 @@ def test_capacity_commitment_path(): location = "clam" capacity_commitment = "whelk" expected = "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( - project=project, location=location, capacity_commitment=capacity_commitment, + project=project, + location=location, + capacity_commitment=capacity_commitment, ) actual = ReservationServiceClient.capacity_commitment_path( project, location, capacity_commitment @@ -6729,8 +7255,12 @@ def test_reservation_path(): project = "cuttlefish" location = "mussel" reservation = "winkle" - expected = "projects/{project}/locations/{location}/reservations/{reservation}".format( - project=project, location=location, reservation=reservation, + expected = ( + "projects/{project}/locations/{location}/reservations/{reservation}".format( + project=project, + location=location, + reservation=reservation, + ) ) actual = ReservationServiceClient.reservation_path(project, location, reservation) assert expected == actual @@ -6771,7 +7301,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "whelk" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = ReservationServiceClient.common_folder_path(folder) assert expected == actual @@ -6789,7 +7321,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "oyster" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = ReservationServiceClient.common_organization_path(organization) assert expected == actual @@ -6807,7 +7341,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "cuttlefish" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = ReservationServiceClient.common_project_path(project) assert expected == actual @@ -6827,7 +7363,8 @@ def test_common_location_path(): project = "winkle" location = "nautilus" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = ReservationServiceClient.common_location_path(project, location) assert expected == actual @@ -6852,7 +7389,8 @@ def test_client_with_default_client_info(): transports.ReservationServiceTransport, "_prep_wrapped_messages" ) as prep: client = ReservationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6861,7 +7399,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = ReservationServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6869,7 +7408,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = ReservationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close"