| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…hon-api-core into creds-and-scope-overrides
|
|
||
|
|
||
| def create_channel(target, credentials=None, scopes=None, ssl_credentials=None, **kwargs): | ||
| def create_channel(target, credentials=None, scopes=None, ssl_credentials=None, credentials_file=None, **kwargs): |
There was a problem hiding this comment.
I added credentials_file to the end of the list to avoid breaking anyone who is using positional arguments.
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good, one style/preference concern with exception raising.
Sorry, something went wrong.
| credentials=mock.sentinel.credentials | ||
| ) | ||
|
|
||
| assert "mutually exclusive" in str(excinfo.value) |
There was a problem hiding this comment.
I'm not a huge fan of checking for explicit strings in exception messages. If it's easy and within the style guides of the repo, I like to make one-off exception types and check for the specific exception type within tests, something like
class DuplicateCredentialArgs(Exception):
pass
...
with pytest.raises(DuplicateCredentialArgs) as exc:
...
Sorry, something went wrong.
…hon-api-core into creds-and-scope-overrides
| Back | FazBrowse Home | New Git URL |
Allow credentials files to be passed to create_channel.
For googleapis/gapic-generator-python#432
While it's possible for the library transport to create a credentials object and pass it to create_channel, I think it will be easier in the long run for the auth logic to remain in _create_composite_credentials.