Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
seallard committed Mar 8, 2024
1 parent 961a43f commit 7e6aade
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/integration/services/test_authentication_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ def test_exchange_code(authentication_service: AuthenticationService, user_email
# THEN the refresh token is stored on the user
user: User = authentication_service.store.get_user(user_email)
assert user.refresh_token


def test_refresh_access_token(authentication_service: AuthenticationService, user_email: str):
# GIVEN an encrypted access token
refresh_token: str = authentication_service.encryption_service.encrypt("refresh_token")

# GIVEN an existing user with the refresh token
user: User = authentication_service.store.get_user(user_email)
user.refresh_token = refresh_token

# WHEN refreshing the access token
token: str = authentication_service.refresh_access_token(user.id)

# THEN an access token is returned
assert token

0 comments on commit 7e6aade

Please sign in to comment.