Skip to content

Commit 0c0b0ce

Browse files
committed
refactor: Remove unnecessary comments
1 parent 88717e1 commit 0c0b0ce

File tree

8 files changed

+13
-22
lines changed

8 files changed

+13
-22
lines changed

supertokens_python/recipe/session/interfaces.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ def __init__(
8686
class ReqResInfo:
8787
def __init__(
8888
self,
89-
request: Optional[BaseRequest] = None,
90-
transfer_method: Optional[TokenTransferMethod] = None,
89+
request: BaseRequest,
90+
transfer_method: TokenTransferMethod,
9191
):
92-
# TODO: See if making args optional will cause any issues
9392
self.request = request
9493
self.transfer_method = transfer_method
9594

tests/frontendIntegration/fastapi-server/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_app_port():
144144

145145

146146
def config(
147-
enable_anti_csrf: bool, enable_jwt: bool, jwt_property_name: Union[str, None]
147+
enable_anti_csrf: bool, enable_jwt: bool, _jwt_property_name: Union[str, None]
148148
):
149149
anti_csrf: Literal["VIA_TOKEN", "NONE"] = "NONE"
150150
if enable_anti_csrf:

tests/frontendIntegration/flask-server/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def get_app_port():
166166

167167

168168
def config(
169-
enable_anti_csrf: bool, enable_jwt: bool, jwt_property_name: Union[str, None]
169+
enable_anti_csrf: bool, enable_jwt: bool, _jwt_property_name: Union[str, None]
170170
):
171171
anti_csrf: Literal["VIA_TOKEN", "NONE"] = "NONE"
172172
if enable_anti_csrf:

tests/sessions/claims/test_assert_claims.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from supertokens_python.recipe.session.claims import PrimitiveClaim
1111
from supertokens_python.recipe.session.interfaces import (
1212
JSONObject,
13-
ReqResInfo,
1413
SessionClaimValidator,
1514
ClaimValidationResult,
1615
SessionClaim,
@@ -50,7 +49,7 @@ async def test_should_not_throw_for_empty_array():
5049
"test_session_handle",
5150
"test_user_id",
5251
{}, # user_data_in_access_token
53-
ReqResInfo(None, None),
52+
None,
5453
False, # access_token_updated
5554
)
5655
with patch.object(
@@ -87,7 +86,7 @@ async def test_should_call_validate_with_the_same_payload_object():
8786
"test_session_handle",
8887
"test_user_id",
8988
payload, # user_data_in_access_token
90-
ReqResInfo(None, None),
89+
None, # req_res_info
9190
False, # access_token_updated
9291
)
9392

tests/sessions/claims/test_fetch_and_set_claim.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from pytest import mark
44

5-
from supertokens_python.recipe.session.interfaces import ReqResInfo
65
from supertokens_python.recipe.session.session_class import Session
76
from tests.sessions.claims.utils import NoneClaim, TrueClaim
87
from tests.utils import AsyncMock, MagicMock
@@ -30,7 +29,7 @@ async def test_should_not_change_if_claim_fetch_value_returns_none():
3029
"test_session_handle",
3130
"test_user_id",
3231
{}, # user_data_in_access_token
33-
ReqResInfo(None, None),
32+
None,
3433
False, # access_token_updated
3534
)
3635

@@ -61,7 +60,7 @@ async def test_should_update_if_claim_fetch_value_returns_value(timestamp: int):
6160
"test_session_handle",
6261
"test_user_id",
6362
{}, # user_data_in_access_token
64-
ReqResInfo(None, None),
63+
None, # req_res_info
6564
False, # access_token_updated
6665
)
6766
with patch.object(

tests/sessions/claims/test_remove_claim.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
get_session_information,
1111
remove_claim,
1212
)
13-
from supertokens_python.recipe.session.interfaces import ReqResInfo
1413
from supertokens_python.recipe.session.session_class import Session
1514
from tests.sessions.claims.utils import TrueClaim, get_st_init_args
1615
from tests.utils import AsyncMock, setup_function, start_st, teardown_function
@@ -39,7 +38,7 @@ async def test_should_attempt_to_set_claim_to_none():
3938
"test_session_handle",
4039
"test_user_id",
4140
{}, # user_data_in_access_token
42-
ReqResInfo(None, None),
41+
None, # req_res_info
4342
False, # access_token_updated
4443
)
4544
with patch.object(
@@ -78,9 +77,7 @@ async def test_should_clear_previously_set_claim_using_handle(timestamp: int):
7877

7978
session_info = await get_session_information(s.get_handle())
8079
assert session_info is not None
81-
payload_after = (
82-
session_info.access_token_payload
83-
) # FIXME: This doesn't have stuff other than userData?
80+
payload_after = session_info.access_token_payload
8481
assert payload_after == {}
8582

8683

tests/sessions/claims/test_set_claim_value.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
get_session_information,
1010
set_claim_value,
1111
)
12-
from supertokens_python.recipe.session.interfaces import ReqResInfo
1312
from supertokens_python.recipe.session.session_class import Session
1413
from tests.sessions.claims.utils import TrueClaim, get_st_init_args
1514
from tests.utils import AsyncMock, setup_function, start_st, teardown_function
@@ -40,7 +39,7 @@ async def test_should_merge_the_right_value(timestamp: int):
4039
"test_session_handle",
4140
"test_user_id",
4241
{}, # user_data_in_access_token
43-
ReqResInfo(None, None),
42+
None, # req_res_info
4443
False, # access_token_updated
4544
)
4645
with patch.object(
@@ -88,7 +87,6 @@ async def test_should_overwrite_claim_value_using_session_handle(timestamp: int)
8887
s = await get_session_information(s.get_handle())
8988
assert s is not None
9089
payload = s.access_token_payload
91-
# FIXME: Shouldn't this have other protected_keys as well??
9290
assert payload == {"st-true": {"t": timestamp, "v": False}}
9391

9492

tests/sessions/claims/test_verify_session.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
ClaimValidationResult,
2323
SessionContainer,
2424
ClaimsValidationResult,
25-
ReqResInfo,
2625
)
2726
from supertokens_python.recipe.session.session_class import Session
2827
from tests.sessions.claims.utils import TrueClaim, NoneClaim
@@ -369,7 +368,7 @@ async def test_should_reject_if_assert_claims_returns_an_error(
369368
"test_session_handle",
370369
"test_user_id",
371370
{}, # user_data_in_access_token
372-
ReqResInfo(None, None),
371+
None, # req_res_info
373372
False, # access_token_updated
374373
)
375374
with patch.object(Session, "assert_claims", wraps=s.assert_claims) as mock:
@@ -417,7 +416,7 @@ async def test_should_allow_if_assert_claims_returns_no_error(
417416
"test_session_handle",
418417
"test_user_id",
419418
{}, # user_data_in_access_token
420-
ReqResInfo(None, None),
419+
None, # req_res_info
421420
False, # access_token_updated
422421
)
423422

0 commit comments

Comments
 (0)