Skip to content

Commit

Permalink
New failing test for year overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Mar 9, 2022
1 parent 4f5cd46 commit 93db7ce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_itsdangerous/test_timed.py
@@ -1,3 +1,4 @@
import sys
from datetime import datetime
from datetime import timedelta
from datetime import timezone
Expand Down Expand Up @@ -66,6 +67,18 @@ def test_malformed_timestamp(self, signer):
assert "Malformed" in str(exc_info.value)
assert exc_info.value.date_signed is None

@pytest.mark.skipif(
sys.platform == "win32", reason="Freezegun Invalid argument occurs on Windows"
)
def test_malformed_future_timestamp(self, signer):
signed = b"value.TgPVoaGhoQ.AGBfQ6G6cr07byTRt0zAdPljHOY"

with pytest.raises(BadTimeSignature) as exc_info:
signer.unsign(signed)

assert "Malformed" in str(exc_info.value)
assert exc_info.value.date_signed is None

def test_future_age(self, signer):
signed = signer.sign("value")

Expand Down

0 comments on commit 93db7ce

Please sign in to comment.