@@ -256,20 +256,20 @@ def test_container_analysis_client_client_options(
256256 # unsupported value.
257257 with mock .patch .dict (os .environ , {"GOOGLE_API_USE_MTLS_ENDPOINT" : "Unsupported" }):
258258 with pytest .raises (MutualTLSChannelError ):
259- client = client_class ()
259+ client = client_class (transport = transport_name )
260260
261261 # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value.
262262 with mock .patch .dict (
263263 os .environ , {"GOOGLE_API_USE_CLIENT_CERTIFICATE" : "Unsupported" }
264264 ):
265265 with pytest .raises (ValueError ):
266- client = client_class ()
266+ client = client_class (transport = transport_name )
267267
268268 # Check the case quota_project_id is provided
269269 options = client_options .ClientOptions (quota_project_id = "octopus" )
270270 with mock .patch .object (transport_class , "__init__" ) as patched :
271271 patched .return_value = None
272- client = client_class (transport = transport_name , client_options = options )
272+ client = client_class (client_options = options , transport = transport_name )
273273 patched .assert_called_once_with (
274274 credentials = None ,
275275 credentials_file = None ,
@@ -338,7 +338,7 @@ def test_container_analysis_client_mtls_env_auto(
338338 )
339339 with mock .patch .object (transport_class , "__init__" ) as patched :
340340 patched .return_value = None
341- client = client_class (transport = transport_name , client_options = options )
341+ client = client_class (client_options = options , transport = transport_name )
342342
343343 if use_client_cert_env == "false" :
344344 expected_client_cert_source = None
@@ -433,7 +433,7 @@ def test_container_analysis_client_client_options_scopes(
433433 options = client_options .ClientOptions (scopes = ["1" , "2" ],)
434434 with mock .patch .object (transport_class , "__init__" ) as patched :
435435 patched .return_value = None
436- client = client_class (transport = transport_name , client_options = options )
436+ client = client_class (client_options = options , transport = transport_name )
437437 patched .assert_called_once_with (
438438 credentials = None ,
439439 credentials_file = None ,
@@ -464,7 +464,7 @@ def test_container_analysis_client_client_options_credentials_file(
464464 options = client_options .ClientOptions (credentials_file = "credentials.json" )
465465 with mock .patch .object (transport_class , "__init__" ) as patched :
466466 patched .return_value = None
467- client = client_class (transport = transport_name , client_options = options )
467+ client = client_class (client_options = options , transport = transport_name )
468468 patched .assert_called_once_with (
469469 credentials = None ,
470470 credentials_file = "credentials.json" ,
@@ -497,9 +497,8 @@ def test_container_analysis_client_client_options_from_dict():
497497 )
498498
499499
500- def test_set_iam_policy (
501- transport : str = "grpc" , request_type = iam_policy_pb2 .SetIamPolicyRequest
502- ):
500+ @pytest .mark .parametrize ("request_type" , [iam_policy_pb2 .SetIamPolicyRequest , dict ,])
501+ def test_set_iam_policy (request_type , transport : str = "grpc" ):
503502 client = ContainerAnalysisClient (
504503 credentials = ga_credentials .AnonymousCredentials (), transport = transport ,
505504 )
@@ -525,10 +524,6 @@ def test_set_iam_policy(
525524 assert response .etag == b"etag_blob"
526525
527526
528- def test_set_iam_policy_from_dict ():
529- test_set_iam_policy (request_type = dict )
530-
531-
532527def test_set_iam_policy_empty_call ():
533528 # This test is a coverage failsafe to make sure that totally empty calls,
534529 # i.e. request == None and no flattened fields passed, work.
@@ -716,9 +711,8 @@ async def test_set_iam_policy_flattened_error_async():
716711 )
717712
718713
719- def test_get_iam_policy (
720- transport : str = "grpc" , request_type = iam_policy_pb2 .GetIamPolicyRequest
721- ):
714+ @pytest .mark .parametrize ("request_type" , [iam_policy_pb2 .GetIamPolicyRequest , dict ,])
715+ def test_get_iam_policy (request_type , transport : str = "grpc" ):
722716 client = ContainerAnalysisClient (
723717 credentials = ga_credentials .AnonymousCredentials (), transport = transport ,
724718 )
@@ -744,10 +738,6 @@ def test_get_iam_policy(
744738 assert response .etag == b"etag_blob"
745739
746740
747- def test_get_iam_policy_from_dict ():
748- test_get_iam_policy (request_type = dict )
749-
750-
751741def test_get_iam_policy_empty_call ():
752742 # This test is a coverage failsafe to make sure that totally empty calls,
753743 # i.e. request == None and no flattened fields passed, work.
@@ -935,9 +925,10 @@ async def test_get_iam_policy_flattened_error_async():
935925 )
936926
937927
938- def test_test_iam_permissions (
939- transport : str = "grpc" , request_type = iam_policy_pb2 .TestIamPermissionsRequest
940- ):
928+ @pytest .mark .parametrize (
929+ "request_type" , [iam_policy_pb2 .TestIamPermissionsRequest , dict ,]
930+ )
931+ def test_test_iam_permissions (request_type , transport : str = "grpc" ):
941932 client = ContainerAnalysisClient (
942933 credentials = ga_credentials .AnonymousCredentials (), transport = transport ,
943934 )
@@ -966,10 +957,6 @@ def test_test_iam_permissions(
966957 assert response .permissions == ["permissions_value" ]
967958
968959
969- def test_test_iam_permissions_from_dict ():
970- test_test_iam_permissions (request_type = dict )
971-
972-
973960def test_test_iam_permissions_empty_call ():
974961 # This test is a coverage failsafe to make sure that totally empty calls,
975962 # i.e. request == None and no flattened fields passed, work.
@@ -1191,10 +1178,10 @@ async def test_test_iam_permissions_flattened_error_async():
11911178 )
11921179
11931180
1194- def test_get_vulnerability_occurrences_summary (
1195- transport : str = "grpc" ,
1196- request_type = containeranalysis . GetVulnerabilityOccurrencesSummaryRequest ,
1197- ):
1181+ @ pytest . mark . parametrize (
1182+ "request_type" , [ containeranalysis . GetVulnerabilityOccurrencesSummaryRequest , dict ,]
1183+ )
1184+ def test_get_vulnerability_occurrences_summary ( request_type , transport : str = "grpc" ):
11981185 client = ContainerAnalysisClient (
11991186 credentials = ga_credentials .AnonymousCredentials (), transport = transport ,
12001187 )
@@ -1220,10 +1207,6 @@ def test_get_vulnerability_occurrences_summary(
12201207 assert isinstance (response , containeranalysis .VulnerabilityOccurrencesSummary )
12211208
12221209
1223- def test_get_vulnerability_occurrences_summary_from_dict ():
1224- test_get_vulnerability_occurrences_summary (request_type = dict )
1225-
1226-
12271210def test_get_vulnerability_occurrences_summary_empty_call ():
12281211 # This test is a coverage failsafe to make sure that totally empty calls,
12291212 # i.e. request == None and no flattened fields passed, work.
@@ -1918,7 +1901,7 @@ def test_parse_common_location_path():
19181901 assert expected == actual
19191902
19201903
1921- def test_client_withDEFAULT_CLIENT_INFO ():
1904+ def test_client_with_default_client_info ():
19221905 client_info = gapic_v1 .client_info .ClientInfo ()
19231906
19241907 with mock .patch .object (
0 commit comments