Skip to content

Commit 6114952

Browse files
committed
style: apply ruff formatting to test files
1 parent b855450 commit 6114952

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

tests/test_entraid_auth.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def test_raises_error_on_invalid_config(self, mock_is_enabled, mock_validate):
6363

6464
@patch("src.common.entraid_auth._create_service_principal_provider")
6565
@patch("src.common.entraid_auth._create_token_manager_config")
66-
@patch.dict("src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "service_principal"})
66+
@patch.dict(
67+
"src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "service_principal"}
68+
)
6769
@patch("src.common.entraid_auth.validate_entraid_config")
6870
@patch("src.common.entraid_auth.is_entraid_auth_enabled")
6971
def test_creates_service_principal_provider(
@@ -88,7 +90,9 @@ def test_creates_service_principal_provider(
8890

8991
@patch("src.common.entraid_auth._create_managed_identity_provider")
9092
@patch("src.common.entraid_auth._create_token_manager_config")
91-
@patch.dict("src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "managed_identity"})
93+
@patch.dict(
94+
"src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "managed_identity"}
95+
)
9296
@patch("src.common.entraid_auth.validate_entraid_config")
9397
@patch("src.common.entraid_auth.is_entraid_auth_enabled")
9498
def test_creates_managed_identity_provider(
@@ -113,7 +117,9 @@ def test_creates_managed_identity_provider(
113117

114118
@patch("src.common.entraid_auth._create_default_credential_provider")
115119
@patch("src.common.entraid_auth._create_token_manager_config")
116-
@patch.dict("src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "default_credential"})
120+
@patch.dict(
121+
"src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "default_credential"}
122+
)
117123
@patch("src.common.entraid_auth.validate_entraid_config")
118124
@patch("src.common.entraid_auth.is_entraid_auth_enabled")
119125
def test_creates_default_credential_provider(
@@ -137,7 +143,9 @@ def test_creates_default_credential_provider(
137143
mock_create_dc_provider.assert_called_once_with(mock_token_config)
138144

139145
@patch("src.common.entraid_auth._create_token_manager_config")
140-
@patch.dict("src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "unsupported_flow"})
146+
@patch.dict(
147+
"src.common.entraid_auth.ENTRAID_CFG", {"auth_flow": "unsupported_flow"}
148+
)
141149
@patch("src.common.entraid_auth.validate_entraid_config")
142150
@patch("src.common.entraid_auth.is_entraid_auth_enabled")
143151
def test_raises_error_on_unsupported_flow(
@@ -180,9 +188,7 @@ def test_creates_token_manager_config(
180188
result = _create_token_manager_config()
181189

182190
# Verify RetryPolicy was created with correct parameters
183-
mock_retry_policy_class.assert_called_once_with(
184-
max_attempts=3, delay_in_ms=100
185-
)
191+
mock_retry_policy_class.assert_called_once_with(max_attempts=3, delay_in_ms=100)
186192

187193
# Verify TokenManagerConfig was created with correct parameters
188194
mock_token_config_class.assert_called_once_with(
@@ -200,9 +206,7 @@ class TestCreateServicePrincipalProvider:
200206

201207
@patch("src.common.entraid_auth.create_from_service_principal")
202208
@patch("src.common.entraid_auth.ENTRAID_CFG")
203-
def test_creates_service_principal_provider(
204-
self, mock_entraid_cfg, mock_create_sp
205-
):
209+
def test_creates_service_principal_provider(self, mock_entraid_cfg, mock_create_sp):
206210
"""Test creating service principal provider."""
207211
mock_entraid_cfg.__getitem__.side_effect = lambda key: {
208212
"client_id": "test-client-id",
@@ -400,4 +404,3 @@ def test_exception_message(self):
400404
def test_exception_is_exception_subclass(self):
401405
"""Test that EntraIDAuthenticationError is an Exception subclass."""
402406
assert issubclass(EntraIDAuthenticationError, Exception)
403-

0 commit comments

Comments
 (0)