From 9ccddc7237d052f2405bb31f2a8e4b6b61a68a94 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 18:09:44 -0500 Subject: [PATCH] chore: use gapic-generator-python 0.56.2 (#47) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update Java and Python dependencies PiperOrigin-RevId: 408420890 Source-Link: https://github.com/googleapis/googleapis/commit/2921f9fb3bfbd16f6b2da0104373e2b47a80a65e Source-Link: https://github.com/googleapis/googleapis-gen/commit/6598ca8cbbf5226733a099c4506518a5af6ff74c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/datastream/async_client.py | 13 +- .../services/datastream/client.py | 25 +- .../services/datastream/transports/base.py | 10 +- .../services/datastream/transports/grpc.py | 6 +- .../datastream/transports/grpc_asyncio.py | 6 +- .../datastream_v1alpha1/types/datastream.py | 8 + .../types/datastream_resources.py | 17 ++ .../datastream_v1alpha1/test_datastream.py | 244 +++++++++++++----- 8 files changed, 235 insertions(+), 94 deletions(-) diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index 7615a8284d29..fbd4a4dbd8d1 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py @@ -19,14 +19,17 @@ from typing import Dict, Sequence, Tuple, Type, Union import pkg_resources -from google.api_core.client_options import ClientOptions # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +from google.api_core.client_options import ClientOptions +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -OptionalRetry = Union[retries.Retry, object] +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py index 310b93428eb8..3c7ff50736a2 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py @@ -14,23 +14,25 @@ # limitations under the License. # from collections import OrderedDict -from distutils import util import os import re from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources -from google.api_core import client_options as client_options_lib # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore -OptionalRetry = Union[retries.Retry, object] +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -344,8 +346,15 @@ def __init__( client_options = client_options_lib.ClientOptions() # Create SSL credentials for mutual TLS if needed. - use_client_cert = bool( - util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")) + if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( + "true", + "false", + ): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + use_client_cert = ( + os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" ) client_cert_source_func = None diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 10f7f7d0ba01..6891b5a5157f 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -18,11 +18,11 @@ import pkg_resources import google.auth # type: ignore -import google.api_core # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore -from google.api_core import operations_v1 # type: ignore +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index a3b97d4617ad..dd346d4cd94d 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py @@ -16,9 +16,9 @@ import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union -from google.api_core import grpc_helpers # type: ignore -from google.api_core import operations_v1 # type: ignore -from google.api_core import gapic_v1 # type: ignore +from google.api_core import grpc_helpers +from google.api_core import operations_v1 +from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py index 97a6d19c485d..e4cafdab6e68 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py @@ -16,9 +16,9 @@ import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union -from google.api_core import gapic_v1 # type: ignore -from google.api_core import grpc_helpers_async # type: ignore -from google.api_core import operations_v1 # type: ignore +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py index 4fc46baed356..cfdf1d3e1ad5 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py @@ -72,26 +72,32 @@ class DiscoverConnectionProfileRequest(proto.Message): Must be in the format ``projects/*/locations/*``. connection_profile (google.cloud.datastream_v1alpha1.types.ConnectionProfile): An ad-hoc ConnectionProfile configuration. + This field is a member of `oneof`_ ``target``. connection_profile_name (str): A reference to an existing ConnectionProfile. + This field is a member of `oneof`_ ``target``. recursive (bool): Whether to retrieve the full hierarchy of data objects (TRUE) or only the current level (FALSE). + This field is a member of `oneof`_ ``depth``. recursion_depth (int): The number of hierarchy levels below the current level to be retrieved. + This field is a member of `oneof`_ ``depth``. oracle_rdbms (google.cloud.datastream_v1alpha1.types.OracleRdbms): Oracle RDBMS to enrich with child data objects and metadata. + This field is a member of `oneof`_ ``data_object``. mysql_rdbms (google.cloud.datastream_v1alpha1.types.MysqlRdbms): MySQL RDBMS to enrich with child data objects and metadata. + This field is a member of `oneof`_ ``data_object``. """ @@ -132,9 +138,11 @@ class DiscoverConnectionProfileResponse(proto.Message): Attributes: oracle_rdbms (google.cloud.datastream_v1alpha1.types.OracleRdbms): Enriched Oracle RDBMS object. + This field is a member of `oneof`_ ``data_object``. mysql_rdbms (google.cloud.datastream_v1alpha1.types.MysqlRdbms): Enriched MySQL RDBMS object. + This field is a member of `oneof`_ ``data_object``. """ diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py index d5a0f252492a..4f1da74d0375 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py @@ -171,9 +171,11 @@ class ForwardSshTunnelConnectivity(proto.Message): Port for the SSH tunnel, default value is 22. password (str): Input only. SSH password. + This field is a member of `oneof`_ ``authentication_method``. private_key (str): Input only. SSH private key. + This field is a member of `oneof`_ ``authentication_method``. """ @@ -346,25 +348,32 @@ class ConnectionProfile(proto.Message): Required. Display name. oracle_profile (google.cloud.datastream_v1alpha1.types.OracleProfile): Oracle ConnectionProfile configuration. + This field is a member of `oneof`_ ``profile``. gcs_profile (google.cloud.datastream_v1alpha1.types.GcsProfile): Cloud Storage ConnectionProfile configuration. + This field is a member of `oneof`_ ``profile``. mysql_profile (google.cloud.datastream_v1alpha1.types.MysqlProfile): MySQL ConnectionProfile configuration. + This field is a member of `oneof`_ ``profile``. no_connectivity (google.cloud.datastream_v1alpha1.types.NoConnectivitySettings): No connectivity option chosen. + This field is a member of `oneof`_ ``connectivity``. static_service_ip_connectivity (google.cloud.datastream_v1alpha1.types.StaticServiceIpConnectivity): Static Service IP connectivity. + This field is a member of `oneof`_ ``connectivity``. forward_ssh_connectivity (google.cloud.datastream_v1alpha1.types.ForwardSshTunnelConnectivity): Forward SSH tunnel connectivity. + This field is a member of `oneof`_ ``connectivity``. private_connectivity (google.cloud.datastream_v1alpha1.types.PrivateConnectivity): Private connectivity. + This field is a member of `oneof`_ ``connectivity``. """ @@ -611,9 +620,11 @@ class SourceConfig(proto.Message): identifier. oracle_source_config (google.cloud.datastream_v1alpha1.types.OracleSourceConfig): Oracle data source configuration + This field is a member of `oneof`_ ``source_stream_config``. mysql_source_config (google.cloud.datastream_v1alpha1.types.MysqlSourceConfig): MySQL data source configuration + This field is a member of `oneof`_ ``source_stream_config``. """ @@ -683,9 +694,11 @@ class GcsDestinationConfig(proto.Message): created. avro_file_format (google.cloud.datastream_v1alpha1.types.AvroFileFormat): AVRO file format configuration. + This field is a member of `oneof`_ ``file_format``. json_file_format (google.cloud.datastream_v1alpha1.types.JsonFileFormat): JSON file format configuration. + This field is a member of `oneof`_ ``file_format``. """ @@ -760,9 +773,11 @@ class Stream(proto.Message): Automatically backfill objects included in the stream source configuration. Specific objects can be excluded. + This field is a member of `oneof`_ ``backfill_strategy``. backfill_none (google.cloud.datastream_v1alpha1.types.Stream.BackfillNoneStrategy): Do not automatically backfill any objects. + This field is a member of `oneof`_ ``backfill_strategy``. errors (Sequence[google.cloud.datastream_v1alpha1.types.Error]): Output only. Errors on the Stream. @@ -795,10 +810,12 @@ class BackfillAllStrategy(proto.Message): oracle_excluded_objects (google.cloud.datastream_v1alpha1.types.OracleRdbms): Oracle data source objects to avoid backfilling. + This field is a member of `oneof`_ ``excluded_objects``. mysql_excluded_objects (google.cloud.datastream_v1alpha1.types.MysqlRdbms): MySQL data source objects to avoid backfilling. + This field is a member of `oneof`_ ``excluded_objects``. """ diff --git a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index efd3ae3c9e32..90c2b27db98f 100644 --- a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -639,7 +639,9 @@ def test_list_connection_profiles_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val def test_list_connection_profiles_flattened_error(): @@ -675,7 +677,9 @@ async def test_list_connection_profiles_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val @pytest.mark.asyncio @@ -1034,7 +1038,9 @@ def test_get_connection_profile_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_get_connection_profile_flattened_error(): @@ -1070,7 +1076,9 @@ async def test_get_connection_profile_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -1249,11 +1257,15 @@ def test_create_connection_profile_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].connection_profile == datastream_resources.ConnectionProfile( - name="name_value" - ) - assert args[0].connection_profile_id == "connection_profile_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].connection_profile + mock_val = datastream_resources.ConnectionProfile(name="name_value") + assert arg == mock_val + arg = args[0].connection_profile_id + mock_val = "connection_profile_id_value" + assert arg == mock_val def test_create_connection_profile_flattened_error(): @@ -1300,11 +1312,15 @@ async def test_create_connection_profile_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].connection_profile == datastream_resources.ConnectionProfile( - name="name_value" - ) - assert args[0].connection_profile_id == "connection_profile_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].connection_profile + mock_val = datastream_resources.ConnectionProfile(name="name_value") + assert arg == mock_val + arg = args[0].connection_profile_id + mock_val = "connection_profile_id_value" + assert arg == mock_val @pytest.mark.asyncio @@ -1493,10 +1509,12 @@ def test_update_connection_profile_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].connection_profile == datastream_resources.ConnectionProfile( - name="name_value" - ) - assert args[0].update_mask == field_mask_pb2.FieldMask(paths=["paths_value"]) + arg = args[0].connection_profile + mock_val = datastream_resources.ConnectionProfile(name="name_value") + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val def test_update_connection_profile_flattened_error(): @@ -1541,10 +1559,12 @@ async def test_update_connection_profile_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].connection_profile == datastream_resources.ConnectionProfile( - name="name_value" - ) - assert args[0].update_mask == field_mask_pb2.FieldMask(paths=["paths_value"]) + arg = args[0].connection_profile + mock_val = datastream_resources.ConnectionProfile(name="name_value") + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val @pytest.mark.asyncio @@ -1721,7 +1741,9 @@ def test_delete_connection_profile_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_delete_connection_profile_flattened_error(): @@ -1757,7 +1779,9 @@ async def test_delete_connection_profile_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -2073,7 +2097,9 @@ def test_list_streams_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val def test_list_streams_flattened_error(): @@ -2107,7 +2133,9 @@ async def test_list_streams_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val @pytest.mark.asyncio @@ -2426,7 +2454,9 @@ def test_get_stream_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_get_stream_flattened_error(): @@ -2460,7 +2490,9 @@ async def test_get_stream_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -2624,9 +2656,15 @@ def test_create_stream_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].stream == datastream_resources.Stream(name="name_value") - assert args[0].stream_id == "stream_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].stream + mock_val = datastream_resources.Stream(name="name_value") + assert arg == mock_val + arg = args[0].stream_id + mock_val = "stream_id_value" + assert arg == mock_val def test_create_stream_flattened_error(): @@ -2667,9 +2705,15 @@ async def test_create_stream_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].stream == datastream_resources.Stream(name="name_value") - assert args[0].stream_id == "stream_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].stream + mock_val = datastream_resources.Stream(name="name_value") + assert arg == mock_val + arg = args[0].stream_id + mock_val = "stream_id_value" + assert arg == mock_val @pytest.mark.asyncio @@ -2835,8 +2879,12 @@ def test_update_stream_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].stream == datastream_resources.Stream(name="name_value") - assert args[0].update_mask == field_mask_pb2.FieldMask(paths=["paths_value"]) + arg = args[0].stream + mock_val = datastream_resources.Stream(name="name_value") + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val def test_update_stream_flattened_error(): @@ -2875,8 +2923,12 @@ async def test_update_stream_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].stream == datastream_resources.Stream(name="name_value") - assert args[0].update_mask == field_mask_pb2.FieldMask(paths=["paths_value"]) + arg = args[0].stream + mock_val = datastream_resources.Stream(name="name_value") + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val @pytest.mark.asyncio @@ -3038,7 +3090,9 @@ def test_delete_stream_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_delete_stream_flattened_error(): @@ -3072,7 +3126,9 @@ async def test_delete_stream_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -3371,7 +3427,9 @@ def test_fetch_static_ips_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_fetch_static_ips_flattened_error(): @@ -3405,7 +3463,9 @@ async def test_fetch_static_ips_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -3694,11 +3754,15 @@ def test_create_private_connection_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].private_connection == datastream_resources.PrivateConnection( - name="name_value" - ) - assert args[0].private_connection_id == "private_connection_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].private_connection + mock_val = datastream_resources.PrivateConnection(name="name_value") + assert arg == mock_val + arg = args[0].private_connection_id + mock_val = "private_connection_id_value" + assert arg == mock_val def test_create_private_connection_flattened_error(): @@ -3745,11 +3809,15 @@ async def test_create_private_connection_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].private_connection == datastream_resources.PrivateConnection( - name="name_value" - ) - assert args[0].private_connection_id == "private_connection_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].private_connection + mock_val = datastream_resources.PrivateConnection(name="name_value") + assert arg == mock_val + arg = args[0].private_connection_id + mock_val = "private_connection_id_value" + assert arg == mock_val @pytest.mark.asyncio @@ -3940,7 +4008,9 @@ def test_get_private_connection_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_get_private_connection_flattened_error(): @@ -3976,7 +4046,9 @@ async def test_get_private_connection_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -4158,7 +4230,9 @@ def test_list_private_connections_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val def test_list_private_connections_flattened_error(): @@ -4194,7 +4268,9 @@ async def test_list_private_connections_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val @pytest.mark.asyncio @@ -4541,7 +4617,9 @@ def test_delete_private_connection_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_delete_private_connection_flattened_error(): @@ -4577,7 +4655,9 @@ async def test_delete_private_connection_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -4741,9 +4821,15 @@ def test_create_route_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].route == datastream_resources.Route(name="name_value") - assert args[0].route_id == "route_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].route + mock_val = datastream_resources.Route(name="name_value") + assert arg == mock_val + arg = args[0].route_id + mock_val = "route_id_value" + assert arg == mock_val def test_create_route_flattened_error(): @@ -4784,9 +4870,15 @@ async def test_create_route_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].route == datastream_resources.Route(name="name_value") - assert args[0].route_id == "route_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].route + mock_val = datastream_resources.Route(name="name_value") + assert arg == mock_val + arg = args[0].route_id + mock_val = "route_id_value" + assert arg == mock_val @pytest.mark.asyncio @@ -4965,7 +5057,9 @@ def test_get_route_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_get_route_flattened_error(): @@ -4999,7 +5093,9 @@ async def test_get_route_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -5168,7 +5264,9 @@ def test_list_routes_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val def test_list_routes_flattened_error(): @@ -5202,7 +5300,9 @@ async def test_list_routes_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val @pytest.mark.asyncio @@ -5500,7 +5600,9 @@ def test_delete_route_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_delete_route_flattened_error(): @@ -5534,7 +5636,9 @@ async def test_delete_route_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio