Skip to content

Commit

Permalink
fix(sdk): remove unused patch and utf-8 argument for encode-decode
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse-numerous committed Oct 28, 2024
1 parent 8eacd92 commit 02bc1c8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions python/tests/test_user_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,14 @@ def test_user_property_returns_user_when_valid_cookie(
mock_graphql_client: GraphQLClient,
) -> None:
user_info = {"user_id": "1", "name": "Test User"}
encoded_info = base64.b64encode(json.dumps(user_info).encode("utf-8")).decode(
"utf-8"
)
encoded_info = base64.b64encode(json.dumps(user_info).encode()).decode()
cg = CookieGetterStub({"numerous_user_info": encoded_info})

with mock.patch("numerous.user_session.User", User):
session = Session(cg, _client=mock_graphql_client)
assert isinstance(session.user, User)
assert session.user is not None
assert session.user.id == "1"
assert session.user.name == "Test User"
session = Session(cg, _client=mock_graphql_client)
assert isinstance(session.user, User)
assert session.user is not None
assert session.user.id == "1"
assert session.user.name == "Test User"


def test_user_info_returns_decoded_info_for_valid_cookie(
Expand Down

0 comments on commit 02bc1c8

Please sign in to comment.