Skip to content

Commit 12c3963

Browse files
gjtorikianclaude
andcommitted
Run ruff format on new connect module files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 38e0333 commit 12c3963

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

src/workos/connect.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ def list_applications(
5757
"""
5858
...
5959

60-
def get_application(
61-
self, application_id: str
62-
) -> SyncOrAsync[ConnectApplication]:
60+
def get_application(self, application_id: str) -> SyncOrAsync[ConnectApplication]:
6361
"""Gets details for a single connect application.
6462
6563
Args:
@@ -133,9 +131,7 @@ def delete_application(self, application_id: str) -> SyncOrAsync[None]:
133131
"""
134132
...
135133

136-
def create_client_secret(
137-
self, application_id: str
138-
) -> SyncOrAsync[ClientSecret]:
134+
def create_client_secret(self, application_id: str) -> SyncOrAsync[ClientSecret]:
139135
"""Create a client secret for a connect application.
140136
141137
Args:
@@ -320,9 +316,7 @@ def list_client_secrets(
320316
params=list_params,
321317
)
322318

323-
return WorkOSListResource[
324-
ClientSecret, ClientSecretListFilters, ListMetadata
325-
](
319+
return WorkOSListResource[ClientSecret, ClientSecretListFilters, ListMetadata](
326320
list_method=partial(self.list_client_secrets, application_id),
327321
list_args=list_params,
328322
**ListPage[ClientSecret](**response).model_dump(),
@@ -472,9 +466,7 @@ async def list_client_secrets(
472466
params=list_params,
473467
)
474468

475-
return WorkOSListResource[
476-
ClientSecret, ClientSecretListFilters, ListMetadata
477-
](
469+
return WorkOSListResource[ClientSecret, ClientSecretListFilters, ListMetadata](
478470
list_method=partial(self.list_client_secrets, application_id),
479471
list_args=list_params,
480472
**ListPage[ClientSecret](**response).model_dump(),

tests/test_connect.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def mock_oauth_application(self):
2525

2626
@pytest.fixture
2727
def mock_applications(self):
28-
application_list = [
29-
MockConnectApplication(id=str(i)).dict() for i in range(10)
30-
]
28+
application_list = [MockConnectApplication(id=str(i)).dict() for i in range(10)]
3129
return {
3230
"data": application_list,
3331
"list_metadata": {"before": None, "after": None},
@@ -56,9 +54,7 @@ def mock_client_secrets(self):
5654

5755
@pytest.fixture
5856
def mock_client_secrets_multiple_data_pages(self):
59-
secrets_list = [
60-
MockClientSecret(id=f"cs_{i + 1}").dict() for i in range(40)
61-
]
57+
secrets_list = [MockClientSecret(id=f"cs_{i + 1}").dict() for i in range(40)]
6258
return list_response_of(data=secrets_list)
6359

6460
# --- Application Tests ---
@@ -247,17 +243,14 @@ def test_list_client_secrets(
247243
self.http_client, mock_client_secrets, 200
248244
)
249245

250-
response = syncify(
251-
self.connect.list_client_secrets(application_id="app_01ABC")
252-
)
246+
response = syncify(self.connect.list_client_secrets(application_id="app_01ABC"))
253247

254248
assert request_kwargs["method"] == "get"
255249
assert request_kwargs["url"].endswith(
256250
"/connect/applications/app_01ABC/client_secrets"
257251
)
258252
assert (
259-
list(map(lambda x: x.dict(), response.data))
260-
== mock_client_secrets["data"]
253+
list(map(lambda x: x.dict(), response.data)) == mock_client_secrets["data"]
261254
)
262255

263256
def test_delete_client_secret(self, capture_and_mock_http_client_request):

tests/utils/fixtures/mock_connect_application.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def __init__(self, id: str, application_type: str = "m2m"):
1919
if application_type == "m2m":
2020
kwargs["organization_id"] = "org_01ABC"
2121
elif application_type == "oauth":
22-
kwargs["redirect_uris"] = [{"uri": "https://example.com/callback", "default": True}]
22+
kwargs["redirect_uris"] = [
23+
{"uri": "https://example.com/callback", "default": True}
24+
]
2325
kwargs["uses_pkce"] = True
2426
kwargs["is_first_party"] = True
2527
kwargs["was_dynamically_registered"] = False

0 commit comments

Comments
 (0)