diff --git a/packages/google-auth/tests/test_impersonated_credentials.py b/packages/google-auth/tests/test_impersonated_credentials.py index 2612858dd40f..f937e871cdf9 100644 --- a/packages/google-auth/tests/test_impersonated_credentials.py +++ b/packages/google-auth/tests/test_impersonated_credentials.py @@ -639,12 +639,19 @@ def _sign_bytes_helper( assert signature == b"signature" - @mock.patch("google.auth.transport.requests.AuthorizedSession.configure_mtls_channel", autospec=True) - def test_sign_bytes_configures_mtls(self, mock_configure_mtls, mock_donor_credentials, mock_authorizedsession_sign): + @mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel", + autospec=True, + ) + def test_sign_bytes_configures_mtls( + self, mock_configure_mtls, mock_donor_credentials, mock_authorizedsession_sign + ): credentials = self.make_credentials(lifetime=None) # Refresh is needed to make credentials valid before signing request = self.make_request( - data=json.dumps({"accessToken": "token", "expireTime": "2026-06-09T00:00:00Z"}), + data=json.dumps( + {"accessToken": "token", "expireTime": "2026-06-09T00:00:00Z"} + ), status=http_client.OK, ) credentials.refresh(request) @@ -764,8 +771,13 @@ def test_with_scopes_provide_default_scopes(self): ) assert credentials._target_scopes == ["fake_scope1"] - @mock.patch("google.auth.transport.requests.AuthorizedSession.configure_mtls_channel", autospec=True) - def test_id_token_refresh_configures_mtls(self, mock_configure_mtls, mock_donor_credentials): + @mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel", + autospec=True, + ) + def test_id_token_refresh_configures_mtls( + self, mock_configure_mtls, mock_donor_credentials + ): credentials = self.make_credentials(lifetime=None) credentials.token = "token" id_creds = impersonated_credentials.IDTokenCredentials( @@ -775,7 +787,9 @@ def test_id_token_refresh_configures_mtls(self, mock_configure_mtls, mock_donor_ with mock.patch( "google.auth.transport.requests.AuthorizedSession.post", autospec=True ) as mock_post: - mock_post.return_value = MockResponse({"token": ID_TOKEN_DATA}, http_client.OK) + mock_post.return_value = MockResponse( + {"token": ID_TOKEN_DATA}, http_client.OK + ) id_creds.refresh(None) mock_configure_mtls.assert_called_once()