| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This pull request refactors the client service templates by delegating endpoint and universe domain logic to the google.api_core.gapic_v1.routing module, which also allowed for the removal of redundant unit tests. The reviewer recommended adding type hints to the _get_default_mtls_endpoint and _get_api_endpoint methods to ensure code clarity following the removal of detailed docstrings.
Sorry, something went wrong.
| {{ service.client_name }}._DEFAULT_UNIVERSE, | ||
| {{ service.client_name }}.DEFAULT_MTLS_ENDPOINT, | ||
| {{ service.client_name }}._DEFAULT_ENDPOINT_TEMPLATE, | ||
| ) |
There was a problem hiding this comment.
shouldn't this be moved to _compat with the others?
Sorry, something went wrong.
| client_universe_domain, | ||
| universe_domain_env, | ||
| {{ service.client_name }}._DEFAULT_UNIVERSE, | ||
| ) |
There was a problem hiding this comment.
Sorry, something went wrong.
|
|
||
| with pytest.raises(MutualTLSChannelError) as excinfo: | ||
| {{ service.client_name }}._get_api_endpoint(None, mock_client_cert_source, mock_universe, "auto") | ||
| assert str(excinfo.value) == "mTLS is not supported in any universe other than googleapis.com." |
There was a problem hiding this comment.
Were these tests carried over? (I don't see get_api_endpoint in the linked PR: #17745
Sorry, something went wrong.
| return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") | ||
| def _get_default_mtls_endpoint(api_endpoint: Optional[str]) -> Optional[str]: | ||
| """Converts api endpoint to mTLS endpoint.""" | ||
| return client_utils.get_default_mtls_endpoint(api_endpoint) |
There was a problem hiding this comment.
I thought the function was being removed?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Updates generator templates and goldens to import public routing helpers from google-api-core gapic_v1 and delegate API endpoint, mTLS, and universe domain resolution methods to it.
Removes duplicate routing unit tests from the generated client unit tests (as they are now fully tested in google-api-core).
Associated / Dependent API Core PR: chore(api-core): move universe and endpoint routing logic to gapic_v1 public helpers(#17745)