Skip to content

Commit

Permalink
Handle invalid cookies in test_redeem_code
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Jul 24, 2024
1 parent 2e6c951 commit 348a3c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/client/components/test_hoyolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ async def test_announcements(client: genshin.Client):
async def test_redeem_code(lclient: genshin.Client):
try:
await lclient.redeem_code("GENSHINGIFT")
except genshin.InvalidCookies:
pytest.skip("Cookie token expired.")
except genshin.RedemptionException as e:
pytest.skip(f"Redemption code is inconsistent: {e}")
except genshin.AccountNotFound:
Expand All @@ -51,6 +53,8 @@ async def test_redeem_code(lclient: genshin.Client):
async def test_starrail_redeem_code(lclient: genshin.Client):
try:
await lclient.redeem_code("HSRGRANDOPEN1", game=genshin.types.Game.STARRAIL)
except genshin.InvalidCookies:
pytest.skip("Cookie token expired.")
except genshin.RedemptionException as e:
pytest.skip(f"Redemption code is inconsistent: {e}")
except genshin.AccountNotFound:
Expand Down

0 comments on commit 348a3c7

Please sign in to comment.