@@ -223,12 +223,13 @@ def test_constructor_custom_query_options_env_config(self, mock_ver):
223223 @mock .patch ("google.cloud.spanner_v1.client._get_spanner_emulator_host" )
224224 def test_instance_admin_api (self , mock_em ):
225225 from google .cloud .spanner_v1 .client import SPANNER_ADMIN_SCOPE
226+ from google .api_core .client_options import ClientOptions
226227
227228 mock_em .return_value = None
228229
229230 credentials = _make_credentials ()
230231 client_info = mock .Mock ()
231- client_options = mock . Mock ( )
232+ client_options = ClientOptions ( quota_project_id = "QUOTA-PROJECT" )
232233 client = self ._make_one (
233234 project = self .PROJECT ,
234235 credentials = credentials ,
@@ -248,19 +249,19 @@ def test_instance_admin_api(self, mock_em):
248249 self .assertIs (again , api )
249250
250251 instance_admin_client .assert_called_once_with (
251- credentials = credentials .with_scopes .return_value ,
252- client_info = client_info ,
253- client_options = client_options ,
252+ credentials = mock .ANY , client_info = client_info , client_options = client_options
254253 )
255254
256255 credentials .with_scopes .assert_called_once_with (expected_scopes )
257256
258257 @mock .patch ("google.cloud.spanner_v1.client._get_spanner_emulator_host" )
259258 def test_instance_admin_api_emulator_env (self , mock_em ):
259+ from google .api_core .client_options import ClientOptions
260+
260261 mock_em .return_value = "emulator.host"
261262 credentials = _make_credentials ()
262263 client_info = mock .Mock ()
263- client_options = mock . Mock ( )
264+ client_options = ClientOptions ( api_endpoint = "endpoint" )
264265 client = self ._make_one (
265266 project = self .PROJECT ,
266267 credentials = credentials ,
@@ -321,11 +322,12 @@ def test_instance_admin_api_emulator_code(self):
321322 @mock .patch ("google.cloud.spanner_v1.client._get_spanner_emulator_host" )
322323 def test_database_admin_api (self , mock_em ):
323324 from google .cloud .spanner_v1 .client import SPANNER_ADMIN_SCOPE
325+ from google .api_core .client_options import ClientOptions
324326
325327 mock_em .return_value = None
326328 credentials = _make_credentials ()
327329 client_info = mock .Mock ()
328- client_options = mock . Mock ( )
330+ client_options = ClientOptions ( quota_project_id = "QUOTA-PROJECT" )
329331 client = self ._make_one (
330332 project = self .PROJECT ,
331333 credentials = credentials ,
@@ -345,19 +347,19 @@ def test_database_admin_api(self, mock_em):
345347 self .assertIs (again , api )
346348
347349 database_admin_client .assert_called_once_with (
348- credentials = credentials .with_scopes .return_value ,
349- client_info = client_info ,
350- client_options = client_options ,
350+ credentials = mock .ANY , client_info = client_info , client_options = client_options
351351 )
352352
353353 credentials .with_scopes .assert_called_once_with (expected_scopes )
354354
355355 @mock .patch ("google.cloud.spanner_v1.client._get_spanner_emulator_host" )
356356 def test_database_admin_api_emulator_env (self , mock_em ):
357+ from google .api_core .client_options import ClientOptions
358+
357359 mock_em .return_value = "host:port"
358360 credentials = _make_credentials ()
359361 client_info = mock .Mock ()
360- client_options = mock . Mock ( )
362+ client_options = ClientOptions ( api_endpoint = "endpoint" )
361363 client = self ._make_one (
362364 project = self .PROJECT ,
363365 credentials = credentials ,
0 commit comments