From 16fa14fbc00db2ea00c0ff9d306a50b0e8dedd50 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 02:30:50 +0000 Subject: [PATCH] style: Reformat tests with black to fix lint error Reformatted packages/google-auth/tests/test_impersonated_credentials.py with `black` to adhere to the project's formatting requirements and resolve the failing CI lint check. Co-authored-by: amtk3 <254821816+amtk3@users.noreply.github.com> --- .../tests/test_impersonated_credentials.py | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) 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()