@@ -239,20 +239,20 @@ def test_iam_checker_client_client_options(
239239 # unsupported value.
240240 with mock .patch .dict (os .environ , {"GOOGLE_API_USE_MTLS_ENDPOINT" : "Unsupported" }):
241241 with pytest .raises (MutualTLSChannelError ):
242- client = client_class ()
242+ client = client_class (transport = transport_name )
243243
244244 # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value.
245245 with mock .patch .dict (
246246 os .environ , {"GOOGLE_API_USE_CLIENT_CERTIFICATE" : "Unsupported" }
247247 ):
248248 with pytest .raises (ValueError ):
249- client = client_class ()
249+ client = client_class (transport = transport_name )
250250
251251 # Check the case quota_project_id is provided
252252 options = client_options .ClientOptions (quota_project_id = "octopus" )
253253 with mock .patch .object (transport_class , "__init__" ) as patched :
254254 patched .return_value = None
255- client = client_class (transport = transport_name , client_options = options )
255+ client = client_class (client_options = options , transport = transport_name )
256256 patched .assert_called_once_with (
257257 credentials = None ,
258258 credentials_file = None ,
@@ -309,7 +309,7 @@ def test_iam_checker_client_mtls_env_auto(
309309 )
310310 with mock .patch .object (transport_class , "__init__" ) as patched :
311311 patched .return_value = None
312- client = client_class (transport = transport_name , client_options = options )
312+ client = client_class (client_options = options , transport = transport_name )
313313
314314 if use_client_cert_env == "false" :
315315 expected_client_cert_source = None
@@ -404,7 +404,7 @@ def test_iam_checker_client_client_options_scopes(
404404 options = client_options .ClientOptions (scopes = ["1" , "2" ],)
405405 with mock .patch .object (transport_class , "__init__" ) as patched :
406406 patched .return_value = None
407- client = client_class (transport = transport_name , client_options = options )
407+ client = client_class (client_options = options , transport = transport_name )
408408 patched .assert_called_once_with (
409409 credentials = None ,
410410 credentials_file = None ,
@@ -435,7 +435,7 @@ def test_iam_checker_client_client_options_credentials_file(
435435 options = client_options .ClientOptions (credentials_file = "credentials.json" )
436436 with mock .patch .object (transport_class , "__init__" ) as patched :
437437 patched .return_value = None
438- client = client_class (transport = transport_name , client_options = options )
438+ client = client_class (client_options = options , transport = transport_name )
439439 patched .assert_called_once_with (
440440 credentials = None ,
441441 credentials_file = "credentials.json" ,
@@ -466,9 +466,8 @@ def test_iam_checker_client_client_options_from_dict():
466466 )
467467
468468
469- def test_troubleshoot_iam_policy (
470- transport : str = "grpc" , request_type = checker .TroubleshootIamPolicyRequest
471- ):
469+ @pytest .mark .parametrize ("request_type" , [checker .TroubleshootIamPolicyRequest , dict ,])
470+ def test_troubleshoot_iam_policy (request_type , transport : str = "grpc" ):
472471 client = IamCheckerClient (
473472 credentials = ga_credentials .AnonymousCredentials (), transport = transport ,
474473 )
@@ -497,10 +496,6 @@ def test_troubleshoot_iam_policy(
497496 assert response .access == explanations .AccessState .GRANTED
498497
499498
500- def test_troubleshoot_iam_policy_from_dict ():
501- test_troubleshoot_iam_policy (request_type = dict )
502-
503-
504499def test_troubleshoot_iam_policy_empty_call ():
505500 # This test is a coverage failsafe to make sure that totally empty calls,
506501 # i.e. request == None and no flattened fields passed, work.
@@ -1028,7 +1023,7 @@ def test_parse_common_location_path():
10281023 assert expected == actual
10291024
10301025
1031- def test_client_withDEFAULT_CLIENT_INFO ():
1026+ def test_client_with_default_client_info ():
10321027 client_info = gapic_v1 .client_info .ClientInfo ()
10331028
10341029 with mock .patch .object (
0 commit comments