Example #1
0
def test_pypale_invalid_token_binascii(
    _example_dot_com_1s_token: Pypale,
) -> None:
    email = test_email(name="user")
    assert not _example_dot_com_1s_token.valid_token(
        return_token="notvalidmultipleof4", return_email=email
    )
Example #2
0
def test_pypale_invalid_token_no_return_token(
    _example_dot_com_1s_token: Pypale,
) -> None:
    email = test_email(name="user")
    assert not _example_dot_com_1s_token.valid_token(
        return_token=None, return_email=email
    )
Example #3
0
def test_pypale_token_issue_expiry(_example_dot_com_1s_token: Pypale) -> None:
    email = test_email()
    token = _example_dot_com_1s_token.generate_token(email=email)
    time.sleep(2)
    assert not _example_dot_com_1s_token.valid_token(
        return_token=token, return_email=email
    )
Example #4
0
def test_pypale_valid_token(_example_dot_com_1s_token: Pypale) -> None:
    email = test_email()
    token = _example_dot_com_1s_token.generate_token(email=email)
    assert _example_dot_com_1s_token.valid_token(return_token=token, return_email=email)
Example #5
0
def test_pypale_invalid_token_no_user(_example_dot_com_1s_token: Pypale) -> None:
    email = test_email(name="user")
    token = _example_dot_com_1s_token.generate_token(email=email)
    assert not _example_dot_com_1s_token.valid_token(
        return_token=token, return_email=None
    )