# Path: transmogrify/utils.py
# def is_tool(name):
# def download_url(url, destination):
# def is_valid_actionstring(action_string):
# def create_securityhash(action_tuples):
# def create_purge_securityhash():  # pragma: no cover
# def generate_url(url, action_string):
# def is_valid_security(action_tuples, security_hash):
# def resolve_request_path(requested_uri):
# def parse_action_tuples(filename):
# def process_url(url, server_name="", document_root=None, check_security=True):
# def get_cached_files(url, server_name="", document_root=None):


from transmogrify import utils
    from hashlib import sha1
    from transmogrify.settings import SECRET_KEY
    from transmogrify import settings
    from transmogrify.core import Transmogrify
    from transmogrify import settings
    import os
"""
Test the utils
"""


def test_is_tool():
    assert utils.is_tool('date') is True
    assert utils.is_tool('foo') is False


def test_purge_security_hash():

    security_hash = sha1('PURGE' + SECRET_KEY).hexdigest()

# Path: transmogrify/utils.py
# def is_tool(name):
# def download_url(url, destination):
# def is_valid_actionstring(action_string):
# def create_securityhash(action_tuples):
# def create_purge_securityhash():  # pragma: no cover
# def generate_url(url, action_string):
# def is_valid_security(action_tuples, security_hash):
# def resolve_request_path(requested_uri):
# def parse_action_tuples(filename):
# def process_url(url, server_name="", document_root=None, check_security=True):
# def get_cached_files(url, server_name="", document_root=None):


# Path: transmogrify/tests/test_utils.py
from transmogrify import utils
    from hashlib import sha1
    from transmogrify.settings import SECRET_KEY
    from transmogrify import settings
    from transmogrify.core import Transmogrify
    from transmogrify import settings
    import os

"""
Test the utils
"""


def test_is_tool():
    assert utils.is_tool('date') is True
    assert utils.is_tool('foo') is False


def test_purge_security_hash():

    security_hash = sha1('PURGE' + SECRET_KEY).hexdigest()

    assert utils.is_valid_security('PURGE', security_hash) is True