Skip to content

Commit 427a6b1

Browse files
committed
fix: Small changes and formatting
1 parent 520a160 commit 427a6b1

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

supertokens_python/recipe/dashboard/recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def reset():
248248

249249
def return_api_id_if_can_handle_request(
250250
self, path: NormalisedURLPath, method: str
251-
) -> Union[str, None]:
251+
) -> Union[ApiIdWithTenantId, None]:
252252
dashboard_bundle_path = self.app_info.api_base_path.append(
253253
NormalisedURLPath(DASHBOARD_API)
254254
)

supertokens_python/recipe_module.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from .exceptions import SuperTokensError
3131
from .normalised_url_path import NormalisedURLPath
3232

33+
3334
class ApiIdWithTenantId:
3435
def __init__(self, api_id: str, tenant_id: Optional[str]):
3536
self.api_id = api_id

tests/multitenancy/test_router.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,28 @@ async def client():
4141

4242

4343
async def test_emailpassword_router(client: TestClient):
44-
args = get_st_init_args([
45-
session.init(get_token_transfer_method=lambda *_: "cookie"),
46-
emailpassword.init()
47-
])
44+
args = get_st_init_args(
45+
[
46+
session.init(get_token_transfer_method=lambda *_: "cookie"),
47+
emailpassword.init(),
48+
]
49+
)
4850
init(**args)
4951
start_st()
5052

5153
res = client.post(
5254
"/auth/public/signup",
5355
headers={"Content-Type": "application/json"},
5456
json={
55-
"formFields": [
56-
{"id": "password", "value": "password1"},
57-
{"id": "email", "value": "[email protected]"},
58-
]
57+
"formFields": [
58+
{"id": "password", "value": "password1"},
59+
{"id": "email", "value": "[email protected]"},
60+
]
5961
},
6062
)
6163

6264
assert res.status_code == 200
63-
assert res.json()['status'] == "OK"
65+
assert res.json()["status"] == "OK"
6466

6567
res = client.post(
6668
"/auth/signup",
@@ -74,14 +76,17 @@ async def test_emailpassword_router(client: TestClient):
7476
)
7577

7678
assert res.status_code == 200
77-
assert res.json()['status'] == "OK"
79+
assert res.json()["status"] == "OK"
80+
7881

7982
async def test_dashboard_apis_router(client: TestClient):
80-
args = get_st_init_args([
81-
session.init(get_token_transfer_method=lambda *_: "cookie"),
82-
emailpassword.init(),
83-
dashboard.init(),
84-
])
83+
args = get_st_init_args(
84+
[
85+
session.init(get_token_transfer_method=lambda *_: "cookie"),
86+
emailpassword.init(),
87+
dashboard.init(),
88+
]
89+
)
8590
init(**args)
8691
start_st()
8792

@@ -96,8 +101,8 @@ async def test_dashboard_apis_router(client: TestClient):
96101
},
97102
)
98103

99-
assert res.status_code == 200 # FIXME: failing test
100-
assert res.json()['status'] == "OK"
104+
assert res.status_code == 200 # FIXME: failing test
105+
assert res.json()["status"] == "OK"
101106

102107
res = client.post(
103108
"/auth/dashboard/api/signin",
@@ -111,4 +116,4 @@ async def test_dashboard_apis_router(client: TestClient):
111116
)
112117

113118
assert res.status_code == 200 # FIXME: failing test
114-
assert res.json()['status'] == "OK"
119+
assert res.json()["status"] == "OK"

tests/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,4 +588,6 @@ async def create_users(
588588
coderesponse.device_id,
589589
)
590590
elif user["recipe"] == "thirdparty" and thirdparty:
591-
await manually_create_or_update_user(user["provider"], user["userId"], user["email"])
591+
await manually_create_or_update_user(
592+
user["provider"], user["userId"], user["email"]
593+
)

0 commit comments

Comments
 (0)