Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
montezdesousa committed May 13, 2024
1 parent 9053415 commit 0c08a53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openbb_platform/core/tests/app/service/test_hub_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def test_platform2hub():
@pytest.mark.parametrize(
"token, message",
[
# valid
(
encode(
{"some": "payload", "exp": int(time()) + 100},
Expand All @@ -323,13 +324,15 @@ def test_platform2hub():
),
None,
),
# expired
(
encode(
{"some": "payload", "exp": int(time())}, "secret", algorithm="HS256"
),
"Platform personal access token expired.",
),
("bad_token", "Failed to decode Platform token."),
# invalid
("invalid_token", "Failed to decode Platform token."),
],
)
def test__check_token_expiration(token, message):
Expand Down

0 comments on commit 0c08a53

Please sign in to comment.