# Path: auxlib/packaging.py
# def get_version(dunder_file):
#     """Returns a version string for the current package, derived
#     either from git or from a .version file.
# 
#     This function is expected to run in two contexts. In a development
#     context, where .git/ exists, the version is pulled from git tags.
#     Using the BuildPyCommand and SDistCommand classes for cmdclass in
#     setup.py will write a .version file into any dist.
# 
#     In an installed context, the .version file written at dist build
#     time is the source of version information.
# 
#     """
#     path = abspath(expanduser(dirname(dunder_file)))
#     try:
#         return _get_version_from_version_file(path) or _get_version_from_git_tag(path)
#     except CalledProcessError as e:
#         log.warn(repr(e))
#         return None
#     except Exception as e:
#         log.exception(e)
#         return None


from unittest import TestCase
from auxlib.packaging import get_version
import os
#             assert _get_version_from_pkg_info('tests') == test_version
#         finally:
#             if os.path.exists('.version'):
#                 os.remove('.version')
#
#     def test_is_git_dirty(self):
#         result = _is_git_dirty(os.getcwd())
#         assert result is True or result is False
#
#
#     def test_get_git_hash(self):
#         hash = _get_git_hash(os.getcwd())
#         assert len(hash) == 7
#
#     def test_not_git_repo(self):
#         assert not is_git_repo(ROOT_PATH)


class TestPackagingNotGitRepo(TestCase):

    def setUp(self):
        super(TestPackagingNotGitRepo, self).setUp()
        self.cwd = os.getcwd()
        os.chdir('/')

    def tearDown(self):
        super(TestPackagingNotGitRepo, self).tearDown()
        os.chdir(self.cwd)

    def test_get_most_recent_git_tag_no_repo(self):

# Path: auxlib/packaging.py
# def get_version(dunder_file):
#     """Returns a version string for the current package, derived
#     either from git or from a .version file.
# 
#     This function is expected to run in two contexts. In a development
#     context, where .git/ exists, the version is pulled from git tags.
#     Using the BuildPyCommand and SDistCommand classes for cmdclass in
#     setup.py will write a .version file into any dist.
# 
#     In an installed context, the .version file written at dist build
#     time is the source of version information.
# 
#     """
#     path = abspath(expanduser(dirname(dunder_file)))
#     try:
#         return _get_version_from_version_file(path) or _get_version_from_git_tag(path)
#     except CalledProcessError as e:
#         log.warn(repr(e))
#         return None
#     except Exception as e:
#         log.exception(e)
#         return None


# Path: tests/test_packaging.py
from unittest import TestCase
from auxlib.packaging import get_version
import os

#             assert _get_version_from_pkg_info('tests') == test_version
#         finally:
#             if os.path.exists('.version'):
#                 os.remove('.version')
#
#     def test_is_git_dirty(self):
#         result = _is_git_dirty(os.getcwd())
#         assert result is True or result is False
#
#
#     def test_get_git_hash(self):
#         hash = _get_git_hash(os.getcwd())
#         assert len(hash) == 7
#
#     def test_not_git_repo(self):
#         assert not is_git_repo(ROOT_PATH)


class TestPackagingNotGitRepo(TestCase):

    def setUp(self):
        super(TestPackagingNotGitRepo, self).setUp()
        self.cwd = os.getcwd()
        os.chdir('/')

    def tearDown(self):
        super(TestPackagingNotGitRepo, self).tearDown()
        os.chdir(self.cwd)

    def test_get_most_recent_git_tag_no_repo(self):

        tag = get_version(os.getcwd())