# Path: djangui/backend/utils.py
# def sanitize_name(name):
# def sanitize_string(value):
# def get_storage(local=True):
# def get_job_commands(job=None):
# def create_djangui_job(user=None, script_pk=None, data=None):
# def get_master_form(model=None, pk=None):
# def get_form_groups(model=None, pk=None, initial=None):
# def validate_form(form=None, data=None, files=None):
# def load_scripts():
# def get_storage_object(path, local=False):
# def add_djangui_script(script=None, group=None):
# def valid_user(obj, user):
# def mkdirs(path):
# def get_file_info(filepath):
# def test_delimited(filepath):
# def test_fastx(filepath):
# def create_job_fileinfo(job):
# def get_file_previews(job):
#     CHOICE_MAPPING = {
# 
#     }


import shutil
from ..models import Script, DjanguiFile, DjanguiJob
from ..backend import utils


class FileCleanupMixin(object):
    def tearDown(self):
        for i in DjanguiFile.objects.all():
            utils.get_storage().delete(i.filepath.path)
        # delete job dirs

# Path: djangui/backend/utils.py
# def sanitize_name(name):
# def sanitize_string(value):
# def get_storage(local=True):
# def get_job_commands(job=None):
# def create_djangui_job(user=None, script_pk=None, data=None):
# def get_master_form(model=None, pk=None):
# def get_form_groups(model=None, pk=None, initial=None):
# def validate_form(form=None, data=None, files=None):
# def load_scripts():
# def get_storage_object(path, local=False):
# def add_djangui_script(script=None, group=None):
# def valid_user(obj, user):
# def mkdirs(path):
# def get_file_info(filepath):
# def test_delimited(filepath):
# def test_fastx(filepath):
# def create_job_fileinfo(job):
# def get_file_previews(job):
#     CHOICE_MAPPING = {
# 
#     }


# Path: djangui/tests/mixins.py
import shutil
from ..models import Script, DjanguiFile, DjanguiJob
from ..backend import utils



class FileCleanupMixin(object):
    def tearDown(self):
        for i in DjanguiFile.objects.all():
            utils.get_storage().delete(i.filepath.path)
        # delete job dirs

        local_storage = utils.get_storage(local=True)