Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb6cea3c

Browse files
authored
Add a repr method for ClientOptions (#9849)
1 parent74326f4 commitb6cea3c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

‎google/api_core/client_options.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class ClientOptions(object):
5050
def__init__(self,api_endpoint=None):
5151
self.api_endpoint=api_endpoint
5252

53+
def__repr__(self):
54+
return"ClientOptions: "+repr(self.__dict__)
55+
5356

5457
deffrom_dict(options):
5558
"""Construct a client options object from a dictionary.

‎tests/unit/test_client_options.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ def test_from_dict_bad_argument():
3434
client_options.from_dict(
3535
{"api_endpoint":"foo.googleapis.com","bad_arg":"1234"}
3636
)
37+
38+
39+
deftest_repr():
40+
options=client_options.ClientOptions(api_endpoint="foo.googleapis.com")
41+
42+
assertrepr(options)=="ClientOptions: {'api_endpoint': 'foo.googleapis.com'}"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp