def test_token_is_valid(app): with set_config(app, AUTH_TOKENS='token-1:token-2'): assert token_is_valid('token-1') assert token_is_valid('token-2')
def test_empty_token_is_invalid(app): with set_config(app, AUTH_TOKENS='valid'): assert not token_is_valid(None) assert not token_is_valid('')
def test_unknown_token_is_not_valid(app): with set_config(app, AUTH_TOKENS='valid'): assert not token_is_valid('invalid')