mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 17:01:35 -05:00
Updated tests to match the formatting work done in the admin repo
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import urllib
|
||||
|
||||
import pytest
|
||||
from itsdangerous import BadSignature, SignatureExpired
|
||||
from pytest import fail
|
||||
|
||||
from notifications_utils.url_safe_token import check_token, generate_token
|
||||
|
||||
@@ -19,7 +19,7 @@ def test_should_throw_exception_when_token_is_tampered_with():
|
||||
token = generate_token(str(uuid.uuid4()), "secret-key", "dangerous-salt")
|
||||
try:
|
||||
check_token(token + "qerqwer", "secret-key", "dangerous-salt", 30)
|
||||
fail()
|
||||
pytest.fail("Expected a BadSignature")
|
||||
except BadSignature:
|
||||
pass
|
||||
|
||||
@@ -31,6 +31,6 @@ def test_return_none_when_token_is_expired():
|
||||
token = urllib.parse.unquote(token)
|
||||
try:
|
||||
assert check_token(token, "secret-key", "dangerous-salt", max_age) is None
|
||||
fail("Expected a SignatureExpired exception")
|
||||
pytest.fail("Expected a SignatureExpired exception")
|
||||
except SignatureExpired:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user