Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api_core/google/api_core/client_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class ClientOptions(object):
def __init__(self, api_endpoint=None):
self.api_endpoint = api_endpoint

def __repr__(self):
return "ClientOptions: " + repr(self.__dict__)


def from_dict(options):
"""Construct a client options object from a dictionary.
Expand Down
6 changes: 6 additions & 0 deletions api_core/tests/unit/test_client_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ def test_from_dict_bad_argument():
client_options.from_dict(
{"api_endpoint": "foo.googleapis.com", "bad_arg": "1234"}
)


def test_repr():
options = client_options.ClientOptions(api_endpoint="foo.googleapis.com")

assert repr(options) == "ClientOptions: {'api_endpoint': 'foo.googleapis.com'}"