# Path: badwolf/security.py
# class SecureToken(object):
# 
#     @staticmethod
#     def encrypt(text):
#         fernet = Fernet(to_binary(current_app.config['SECURE_TOKEN_KEY']))
#         return fernet.encrypt(to_binary(text))
# 
#     @staticmethod
#     def decrypt(encrypted):
#         fernet = Fernet(to_binary(current_app.config['SECURE_TOKEN_KEY']))
#         text = fernet.decrypt(to_binary(encrypted))
#         return to_text(text)


from badwolf.security import SecureToken
# -*- coding: utf-8 -*-



def test_secure_token(app):
    plaintext = 'super secret'
    token = SecureToken.encrypt(plaintext)

# Path: badwolf/security.py
# class SecureToken(object):
# 
#     @staticmethod
#     def encrypt(text):
#         fernet = Fernet(to_binary(current_app.config['SECURE_TOKEN_KEY']))
#         return fernet.encrypt(to_binary(text))
# 
#     @staticmethod
#     def decrypt(encrypted):
#         fernet = Fernet(to_binary(current_app.config['SECURE_TOKEN_KEY']))
#         text = fernet.decrypt(to_binary(encrypted))
#         return to_text(text)


# Path: tests/test_secure_token.py
from badwolf.security import SecureToken

# -*- coding: utf-8 -*-



def test_secure_token(app):
    plaintext = 'super secret'
    token = SecureToken.encrypt(plaintext)

    decrypted = SecureToken.decrypt(token)