@@ -67,6 +67,42 @@ def test_ctor_explicit(self):
6767 self .assertIsInstance (client ._connection , Connection )
6868 self .assertIs (client ._connection ._client_info , client_info )
6969
70+ def test_ctor_w_empty_client_options (self ):
71+ from google .api_core .client_options import ClientOptions
72+
73+ creds = _make_credentials ()
74+ client_options = ClientOptions ()
75+ client = self ._make_one (
76+ project = self .PROJECT , credentials = creds , client_options = client_options
77+ )
78+ self .assertEqual (
79+ client ._connection .API_BASE_URL , client ._connection .DEFAULT_API_ENDPOINT
80+ )
81+
82+ def test_ctor_w_client_options_object (self ):
83+ from google .api_core .client_options import ClientOptions
84+
85+ creds = _make_credentials ()
86+ client_options = ClientOptions (
87+ api_endpoint = "https://foo-logging.googleapis.com"
88+ )
89+ client = self ._make_one (
90+ project = self .PROJECT , credentials = creds , client_options = client_options
91+ )
92+ self .assertEqual (
93+ client ._connection .API_BASE_URL , "https://foo-logging.googleapis.com"
94+ )
95+
96+ def test_ctor_w_client_options_dict (self ):
97+ creds = _make_credentials ()
98+ client_options = {"api_endpoint" : "https://foo-logging.googleapis.com" }
99+ client = self ._make_one (
100+ project = self .PROJECT , credentials = creds , client_options = client_options
101+ )
102+ self .assertEqual (
103+ client ._connection .API_BASE_URL , "https://foo-logging.googleapis.com"
104+ )
105+
70106 def test_logging_api_wo_gapic (self ):
71107 from google .cloud .logging ._http import _LoggingAPI
72108
0 commit comments