@@ -911,33 +911,49 @@ def test_check_use_client_cert_config_fallback(self, mock_file):
911911
912912 assert _mtls_helper .check_use_client_cert () is True
913913
914- @mock .patch ("google.auth.transport._mtls_helper.is_transport_mtls_capable" , autospec = True )
914+ @mock .patch (
915+ "google.auth.transport._mtls_helper.is_transport_mtls_capable" , autospec = True
916+ )
915917 @mock .patch ("os.path.exists" , autospec = True )
916918 @mock .patch ("os.path.getsize" , autospec = True )
917919 @mock .patch .dict (os .environ , {}, clear = True )
918920 def test_well_known_path_success (self , mock_getsize , mock_exists , mock_capable ):
919921 mock_capable .return_value = True
920- mock_exists .side_effect = lambda p : p == _mtls_helper ._WELL_KNOWN_SPIFFE_CERT_PATH
922+ mock_exists .side_effect = (
923+ lambda p : p == _mtls_helper ._WELL_KNOWN_SPIFFE_CERT_PATH
924+ )
921925 mock_getsize .return_value = 100
922926 assert _mtls_helper .check_use_client_cert () is True
923927
924- @mock .patch ("google.auth.transport._mtls_helper.is_transport_mtls_capable" , autospec = True )
928+ @mock .patch (
929+ "google.auth.transport._mtls_helper.is_transport_mtls_capable" , autospec = True
930+ )
925931 @mock .patch ("os.path.exists" , autospec = True )
926932 @mock .patch ("os.path.getsize" , autospec = True )
927933 @mock .patch .dict (os .environ , {}, clear = True )
928934 def test_well_known_path_incapable (self , mock_getsize , mock_exists , mock_capable ):
929935 mock_capable .return_value = False
930- mock_exists .side_effect = lambda p : p == _mtls_helper ._WELL_KNOWN_SPIFFE_CERT_PATH
936+ mock_exists .side_effect = (
937+ lambda p : p == _mtls_helper ._WELL_KNOWN_SPIFFE_CERT_PATH
938+ )
931939 mock_getsize .return_value = 100
932940 assert _mtls_helper .check_use_client_cert () is False
933941
934- @mock .patch ("google.auth.transport._mtls_helper.is_transport_mtls_capable" , autospec = True )
942+ @mock .patch (
943+ "google.auth.transport._mtls_helper.is_transport_mtls_capable" , autospec = True
944+ )
935945 @mock .patch ("os.path.exists" , autospec = True )
936946 @mock .patch ("os.path.getsize" , autospec = True )
937- @mock .patch .dict (os .environ , {"GOOGLE_API_USE_CLIENT_CERTIFICATE" : "false" }, clear = True )
938- def test_explicit_opt_out_with_well_known_path (self , mock_getsize , mock_exists , mock_capable ):
947+ @mock .patch .dict (
948+ os .environ , {"GOOGLE_API_USE_CLIENT_CERTIFICATE" : "false" }, clear = True
949+ )
950+ def test_explicit_opt_out_with_well_known_path (
951+ self , mock_getsize , mock_exists , mock_capable
952+ ):
939953 mock_capable .return_value = True
940- mock_exists .side_effect = lambda p : p == _mtls_helper ._WELL_KNOWN_SPIFFE_CERT_PATH
954+ mock_exists .side_effect = (
955+ lambda p : p == _mtls_helper ._WELL_KNOWN_SPIFFE_CERT_PATH
956+ )
941957 mock_getsize .return_value = 100
942958 assert _mtls_helper .check_use_client_cert () is False
943959
0 commit comments