Skip to content

Commit

Permalink
Finish test
Browse files Browse the repository at this point in the history
  • Loading branch information
Celeo committed Dec 20, 2024
1 parent 2b0b445 commit a8a8b3c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/test_preston.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,17 @@ def test_whoami_unauthorized(empty):
assert empty.whoami() == {}


def test_try_refresh_access_token(empty):
pass
def test_try_refresh_access_token_empty(empty):
empty._try_refresh_access_token()
assert empty.refresh_token is None
assert empty.access_token is None


def test_try_refresh_access_token_has(empty):
empty.refresh_token = 'abc123'
empty.access_token = None
empty._is_access_token_expired = lambda: False
empty.access_expiration = 1.0
empty._get_access_from_refresh = lambda: ('def', 456)
empty._try_refresh_access_token()
assert empty.access_token == 'def'

0 comments on commit a8a8b3c

Please sign in to comment.