# Path: django_productline/utils.py
# def create_or_append_to_zip(file_handle, zip_path, arc_name=None):
# def zipdir(src_path, target_path, wrapdir=''):
# def compare_version(version1, version2):
#     def normalize(v):
# 
# Path: django_productline/testingutils.py
# class NoMigrationsTestCase(DjangoTestCase):
#     """
#     Extend your test cases from this class an migrations will be disabled.
#     """
# 
#     def __init__(self, *args, **kw):
#         from django.conf import settings
#         settings.MIGRATION_MODULES = DisableMigrations()
#         super(DjangoTestCase, self).__init__(*args, **kw)


import os
import os.path
import shutil
from django_productline import utils
from django_productline.testingutils import NoMigrationsTestCase
from __future__ import unicode_literals, print_function



__all__ = ['UtilsTestCase']


class UtilsTestCase(NoMigrationsTestCase):
    def test_zipdir(self):
        """
        Tests the zipdir function
        :return:
        """
        testdatadir = os.path.join(os.path.dirname(__file__), '__testdata__')
        zipthisfolder = os.path.join(testdatadir, 'zipthisfolder')
        os.makedirs(zipthisfolder)
        os.mknod(os.path.join(zipthisfolder, 'file'))
        src_path = os.path.join(testdatadir, 'zipthisfolder')
        target_path = os.path.join(testdatadir, 'result.zip')

# Path: django_productline/utils.py
# def create_or_append_to_zip(file_handle, zip_path, arc_name=None):
# def zipdir(src_path, target_path, wrapdir=''):
# def compare_version(version1, version2):
#     def normalize(v):
# 
# Path: django_productline/testingutils.py
# class NoMigrationsTestCase(DjangoTestCase):
#     """
#     Extend your test cases from this class an migrations will be disabled.
#     """
# 
#     def __init__(self, *args, **kw):
#         from django.conf import settings
#         settings.MIGRATION_MODULES = DisableMigrations()
#         super(DjangoTestCase, self).__init__(*args, **kw)


# Path: django_productline/tests/utils_tests.py
import os
import os.path
import shutil
from django_productline import utils
from django_productline.testingutils import NoMigrationsTestCase

from __future__ import unicode_literals, print_function



__all__ = ['UtilsTestCase']


class UtilsTestCase(NoMigrationsTestCase):
    def test_zipdir(self):
        """
        Tests the zipdir function
        :return:
        """
        testdatadir = os.path.join(os.path.dirname(__file__), '__testdata__')
        zipthisfolder = os.path.join(testdatadir, 'zipthisfolder')
        os.makedirs(zipthisfolder)
        os.mknod(os.path.join(zipthisfolder, 'file'))
        src_path = os.path.join(testdatadir, 'zipthisfolder')
        target_path = os.path.join(testdatadir, 'result.zip')

        utils.zipdir(src_path, target_path)