From b12a2cdfb0906232f035bafbabedfecb0d24a815 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 23:46:11 +0000 Subject: [PATCH] chore: Use gapic-generator-python 0.65.0 (#132) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 440970084 Source-Link: https://github.com/googleapis/googleapis/commit/5e0a3d57254ab9857ccac77fc6ffade7b69a2dc7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0c628a3fade768f225d76992791ea1ba2a881be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9 docs: fix type in docstring for map fields --- .../services/domains/async_client.py | 13 +-- .../domains_v1/services/domains/client.py | 13 +-- .../services/domains/transports/base.py | 5 ++ .../services/domains/transports/grpc.py | 4 + google/cloud/domains_v1/types/domains.py | 2 +- .../services/domains/async_client.py | 13 +-- .../services/domains/client.py | 13 +-- .../services/domains/transports/base.py | 5 ++ .../services/domains/transports/grpc.py | 4 + google/cloud/domains_v1beta1/types/domains.py | 2 +- tests/unit/gapic/domains_v1/test_domains.py | 81 ++++++++++++++----- .../gapic/domains_v1beta1/test_domains.py | 81 ++++++++++++++----- 12 files changed, 148 insertions(+), 88 deletions(-) diff --git a/google/cloud/domains_v1/services/domains/async_client.py b/google/cloud/domains_v1/services/domains/async_client.py index bdaf0eb..ae729fc 100644 --- a/google/cloud/domains_v1/services/domains/async_client.py +++ b/google/cloud/domains_v1/services/domains/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -219,7 +219,6 @@ async def search_domains( ``RetrieveRegisterParameters`` on a domain before registering to confirm availability. - .. code-block:: python from google.cloud import domains_v1 @@ -326,7 +325,6 @@ async def retrieve_register_parameters( price and up-to-date availability. Use the returned values to call ``RegisterDomain``. - .. code-block:: python from google.cloud import domains_v1 @@ -446,7 +444,6 @@ async def register_domain( registered successfully, and you can safely delete the resource and retry registration. - .. code-block:: python from google.cloud import domains_v1 @@ -613,7 +610,6 @@ async def retrieve_transfer_parameters( Use the returned values to call ``TransferDomain``. - .. code-block:: python from google.cloud import domains_v1 @@ -744,7 +740,6 @@ async def transfer_domain( ``TRANSFER_FAILED``. If transfer fails, you can safely delete the resource and retry the transfer. - .. code-block:: python from google.cloud import domains_v1 @@ -1156,7 +1151,6 @@ async def update_registration( - To update contact information, see ``ConfigureContactSettings`` - .. code-block:: python from google.cloud import domains_v1 @@ -1610,7 +1604,6 @@ async def configure_contact_settings( r"""Updates a ``Registration``'s contact settings. Some changes require confirmation by the domain's registrant contact . - .. code-block:: python from google.cloud import domains_v1 @@ -1770,7 +1763,6 @@ async def export_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1 @@ -1921,7 +1913,6 @@ async def delete_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1 @@ -2046,7 +2037,6 @@ async def retrieve_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1 @@ -2147,7 +2137,6 @@ async def reset_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1 diff --git a/google/cloud/domains_v1/services/domains/client.py b/google/cloud/domains_v1/services/domains/client.py index 5c1c155..a4c3b50 100644 --- a/google/cloud/domains_v1/services/domains/client.py +++ b/google/cloud/domains_v1/services/domains/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -449,7 +449,6 @@ def search_domains( ``RetrieveRegisterParameters`` on a domain before registering to confirm availability. - .. code-block:: python from google.cloud import domains_v1 @@ -556,7 +555,6 @@ def retrieve_register_parameters( price and up-to-date availability. Use the returned values to call ``RegisterDomain``. - .. code-block:: python from google.cloud import domains_v1 @@ -678,7 +676,6 @@ def register_domain( registered successfully, and you can safely delete the resource and retry registration. - .. code-block:: python from google.cloud import domains_v1 @@ -845,7 +842,6 @@ def retrieve_transfer_parameters( Use the returned values to call ``TransferDomain``. - .. code-block:: python from google.cloud import domains_v1 @@ -978,7 +974,6 @@ def transfer_domain( ``TRANSFER_FAILED``. If transfer fails, you can safely delete the resource and retry the transfer. - .. code-block:: python from google.cloud import domains_v1 @@ -1390,7 +1385,6 @@ def update_registration( - To update contact information, see ``ConfigureContactSettings`` - .. code-block:: python from google.cloud import domains_v1 @@ -1846,7 +1840,6 @@ def configure_contact_settings( r"""Updates a ``Registration``'s contact settings. Some changes require confirmation by the domain's registrant contact . - .. code-block:: python from google.cloud import domains_v1 @@ -2008,7 +2001,6 @@ def export_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1 @@ -2159,7 +2151,6 @@ def delete_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1 @@ -2284,7 +2275,6 @@ def retrieve_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1 @@ -2387,7 +2377,6 @@ def reset_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1 diff --git a/google/cloud/domains_v1/services/domains/transports/base.py b/google/cloud/domains_v1/services/domains/transports/base.py index 18d4c7d..ae07a35 100644 --- a/google/cloud/domains_v1/services/domains/transports/base.py +++ b/google/cloud/domains_v1/services/domains/transports/base.py @@ -82,6 +82,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -357,5 +358,9 @@ def reset_authorization_code( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("DomainsTransport",) diff --git a/google/cloud/domains_v1/services/domains/transports/grpc.py b/google/cloud/domains_v1/services/domains/transports/grpc.py index 6625a92..4409172 100644 --- a/google/cloud/domains_v1/services/domains/transports/grpc.py +++ b/google/cloud/domains_v1/services/domains/transports/grpc.py @@ -746,5 +746,9 @@ def reset_authorization_code( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("DomainsGrpcTransport",) diff --git a/google/cloud/domains_v1/types/domains.py b/google/cloud/domains_v1/types/domains.py index 48b5a30..724bc6c 100644 --- a/google/cloud/domains_v1/types/domains.py +++ b/google/cloud/domains_v1/types/domains.py @@ -135,7 +135,7 @@ class Registration(proto.Message): issues (Sequence[google.cloud.domains_v1.types.Registration.Issue]): Output only. The set of issues with the ``Registration`` that require attention. - labels (Sequence[google.cloud.domains_v1.types.Registration.LabelsEntry]): + labels (Mapping[str, str]): Set of labels associated with the ``Registration``. management_settings (google.cloud.domains_v1.types.ManagementSettings): Settings for management of the ``Registration``, including diff --git a/google/cloud/domains_v1beta1/services/domains/async_client.py b/google/cloud/domains_v1beta1/services/domains/async_client.py index 73275bb..74be1fc 100644 --- a/google/cloud/domains_v1beta1/services/domains/async_client.py +++ b/google/cloud/domains_v1beta1/services/domains/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -219,7 +219,6 @@ async def search_domains( ``RetrieveRegisterParameters`` on a domain before registering to confirm availability. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -326,7 +325,6 @@ async def retrieve_register_parameters( price and up-to-date availability. Use the returned values to call ``RegisterDomain``. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -446,7 +444,6 @@ async def register_domain( registered successfully, and you can safely delete the resource and retry registration. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -613,7 +610,6 @@ async def retrieve_transfer_parameters( Use the returned values to call ``TransferDomain``. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -744,7 +740,6 @@ async def transfer_domain( ``TRANSFER_FAILED``. If transfer fails, you can safely delete the resource and retry the transfer. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -1156,7 +1151,6 @@ async def update_registration( - To update contact information, see ``ConfigureContactSettings`` - .. code-block:: python from google.cloud import domains_v1beta1 @@ -1610,7 +1604,6 @@ async def configure_contact_settings( r"""Updates a ``Registration``'s contact settings. Some changes require confirmation by the domain's registrant contact . - .. code-block:: python from google.cloud import domains_v1beta1 @@ -1770,7 +1763,6 @@ async def export_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -1921,7 +1913,6 @@ async def delete_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -2046,7 +2037,6 @@ async def retrieve_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -2147,7 +2137,6 @@ async def reset_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1beta1 diff --git a/google/cloud/domains_v1beta1/services/domains/client.py b/google/cloud/domains_v1beta1/services/domains/client.py index 042de1f..d2902d1 100644 --- a/google/cloud/domains_v1beta1/services/domains/client.py +++ b/google/cloud/domains_v1beta1/services/domains/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -449,7 +449,6 @@ def search_domains( ``RetrieveRegisterParameters`` on a domain before registering to confirm availability. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -556,7 +555,6 @@ def retrieve_register_parameters( price and up-to-date availability. Use the returned values to call ``RegisterDomain``. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -678,7 +676,6 @@ def register_domain( registered successfully, and you can safely delete the resource and retry registration. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -845,7 +842,6 @@ def retrieve_transfer_parameters( Use the returned values to call ``TransferDomain``. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -978,7 +974,6 @@ def transfer_domain( ``TRANSFER_FAILED``. If transfer fails, you can safely delete the resource and retry the transfer. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -1390,7 +1385,6 @@ def update_registration( - To update contact information, see ``ConfigureContactSettings`` - .. code-block:: python from google.cloud import domains_v1beta1 @@ -1846,7 +1840,6 @@ def configure_contact_settings( r"""Updates a ``Registration``'s contact settings. Some changes require confirmation by the domain's registrant contact . - .. code-block:: python from google.cloud import domains_v1beta1 @@ -2008,7 +2001,6 @@ def export_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -2159,7 +2151,6 @@ def delete_registration( The domain does not renew automatically unless the new owner sets up billing in Google Domains. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -2284,7 +2275,6 @@ def retrieve_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1beta1 @@ -2387,7 +2377,6 @@ def reset_authorization_code( You can call this method only after 60 days have elapsed since the initial domain registration. - .. code-block:: python from google.cloud import domains_v1beta1 diff --git a/google/cloud/domains_v1beta1/services/domains/transports/base.py b/google/cloud/domains_v1beta1/services/domains/transports/base.py index f00878e..fb2088a 100644 --- a/google/cloud/domains_v1beta1/services/domains/transports/base.py +++ b/google/cloud/domains_v1beta1/services/domains/transports/base.py @@ -82,6 +82,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -357,5 +358,9 @@ def reset_authorization_code( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("DomainsTransport",) diff --git a/google/cloud/domains_v1beta1/services/domains/transports/grpc.py b/google/cloud/domains_v1beta1/services/domains/transports/grpc.py index d48be03..2fe1fe6 100644 --- a/google/cloud/domains_v1beta1/services/domains/transports/grpc.py +++ b/google/cloud/domains_v1beta1/services/domains/transports/grpc.py @@ -746,5 +746,9 @@ def reset_authorization_code( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("DomainsGrpcTransport",) diff --git a/google/cloud/domains_v1beta1/types/domains.py b/google/cloud/domains_v1beta1/types/domains.py index 28a3647..4521f16 100644 --- a/google/cloud/domains_v1beta1/types/domains.py +++ b/google/cloud/domains_v1beta1/types/domains.py @@ -135,7 +135,7 @@ class Registration(proto.Message): issues (Sequence[google.cloud.domains_v1beta1.types.Registration.Issue]): Output only. The set of issues with the ``Registration`` that require attention. - labels (Sequence[google.cloud.domains_v1beta1.types.Registration.LabelsEntry]): + labels (Mapping[str, str]): Set of labels associated with the ``Registration``. management_settings (google.cloud.domains_v1beta1.types.ManagementSettings): Settings for management of the ``Registration``, including diff --git a/tests/unit/gapic/domains_v1/test_domains.py b/tests/unit/gapic/domains_v1/test_domains.py index d0e1e08..41368fe 100644 --- a/tests/unit/gapic/domains_v1/test_domains.py +++ b/tests/unit/gapic/domains_v1/test_domains.py @@ -88,24 +88,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DomainsClient, - DomainsAsyncClient, + (DomainsClient, "grpc"), + (DomainsAsyncClient, "grpc_asyncio"), ], ) -def test_domains_client_from_service_account_info(client_class): +def test_domains_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "domains.googleapis.com:443" + assert client.transport._host == ("domains.googleapis.com:443") @pytest.mark.parametrize( @@ -132,27 +132,31 @@ def test_domains_client_service_account_always_use_jwt(transport_class, transpor @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DomainsClient, - DomainsAsyncClient, + (DomainsClient, "grpc"), + (DomainsAsyncClient, "grpc_asyncio"), ], ) -def test_domains_client_from_service_account_file(client_class): +def test_domains_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "domains.googleapis.com:443" + assert client.transport._host == ("domains.googleapis.com:443") def test_domains_client_get_transport_class(): @@ -2232,7 +2236,7 @@ async def test_list_registrations_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2280,7 +2284,9 @@ async def test_list_registrations_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_registrations(request={})).pages: + async for page_ in ( + await client.list_registrations(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4678,6 +4684,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = DomainsClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = DomainsClient( @@ -4739,6 +4758,14 @@ def test_domains_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_domains_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -4881,24 +4908,40 @@ def test_domains_grpc_transport_client_cert_source_for_mtls(transport_class): ) -def test_domains_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_domains_host_no_port(transport_name): client = DomainsClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="domains.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "domains.googleapis.com:443" + assert client.transport._host == ("domains.googleapis.com:443") -def test_domains_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_domains_host_with_port(transport_name): client = DomainsClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="domains.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "domains.googleapis.com:8000" + assert client.transport._host == ("domains.googleapis.com:8000") def test_domains_grpc_transport_channel(): diff --git a/tests/unit/gapic/domains_v1beta1/test_domains.py b/tests/unit/gapic/domains_v1beta1/test_domains.py index ad20720..ecd6e6f 100644 --- a/tests/unit/gapic/domains_v1beta1/test_domains.py +++ b/tests/unit/gapic/domains_v1beta1/test_domains.py @@ -88,24 +88,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DomainsClient, - DomainsAsyncClient, + (DomainsClient, "grpc"), + (DomainsAsyncClient, "grpc_asyncio"), ], ) -def test_domains_client_from_service_account_info(client_class): +def test_domains_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "domains.googleapis.com:443" + assert client.transport._host == ("domains.googleapis.com:443") @pytest.mark.parametrize( @@ -132,27 +132,31 @@ def test_domains_client_service_account_always_use_jwt(transport_class, transpor @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DomainsClient, - DomainsAsyncClient, + (DomainsClient, "grpc"), + (DomainsAsyncClient, "grpc_asyncio"), ], ) -def test_domains_client_from_service_account_file(client_class): +def test_domains_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "domains.googleapis.com:443" + assert client.transport._host == ("domains.googleapis.com:443") def test_domains_client_get_transport_class(): @@ -2232,7 +2236,7 @@ async def test_list_registrations_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2280,7 +2284,9 @@ async def test_list_registrations_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_registrations(request={})).pages: + async for page_ in ( + await client.list_registrations(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4678,6 +4684,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = DomainsClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = DomainsClient( @@ -4739,6 +4758,14 @@ def test_domains_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_domains_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -4881,24 +4908,40 @@ def test_domains_grpc_transport_client_cert_source_for_mtls(transport_class): ) -def test_domains_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_domains_host_no_port(transport_name): client = DomainsClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="domains.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "domains.googleapis.com:443" + assert client.transport._host == ("domains.googleapis.com:443") -def test_domains_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_domains_host_with_port(transport_name): client = DomainsClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="domains.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "domains.googleapis.com:8000" + assert client.transport._host == ("domains.googleapis.com:8000") def test_domains_grpc_transport_channel():