# Path: lib/exception.py
# class MissingException(Exception):
# 
#     def __init__(self, message):
#         # Call the base class constructor with the parameters it needs
#         super(MissingException, self).__init__(message)
#         self.returncode = 4
# 
#         logg = Logger('MissingException')
#         logg.error(message)


import unittest
import mock
import os
from lib.exception import MissingException
        from lib.util import getAbsInsensitivePath
        from lib.loghelper import Logger

    def test_getAbsInsensitivePath(self):

        log = Logger("FakeLogger")

        base = os.path.dirname(__file__)
        testpaths = [
            {
                "in": os.path.join(base),
                "out": os.path.join(base),
            },
            {
                "in" : os.path.join(base, "../tools/topometrics"),
                "out": os.path.join(base, "../tools/topometrics"),
            },
            {
                "in": os.path.join(base, "../tools/topometrics/topometrics.py"),
                "out": os.path.join(base, "../tools/topometrics/topometrics.py"),
            },
            {
                "in": os.path.join(base, "../TOOLS/topoMetrics"),
                "out": os.path.join(base, "../tools/topometrics"),
            },
            {
                "in": os.path.join(base, "../tools\\topoMetrics"),
                "out": os.path.join(base, "../tools/topometrics"),
            },
        ]
        # Test the normal case (we're catching warnings too)
        for testpath in testpaths:

# Path: lib/exception.py
# class MissingException(Exception):
# 
#     def __init__(self, message):
#         # Call the base class constructor with the parameters it needs
#         super(MissingException, self).__init__(message)
#         self.returncode = 4
# 
#         logg = Logger('MissingException')
#         logg.error(message)


# Path: test/test_util.py
import unittest
import mock
import os
from lib.exception import MissingException
        from lib.util import getAbsInsensitivePath
        from lib.loghelper import Logger


    def test_getAbsInsensitivePath(self):

        log = Logger("FakeLogger")

        base = os.path.dirname(__file__)
        testpaths = [
            {
                "in": os.path.join(base),
                "out": os.path.join(base),
            },
            {
                "in" : os.path.join(base, "../tools/topometrics"),
                "out": os.path.join(base, "../tools/topometrics"),
            },
            {
                "in": os.path.join(base, "../tools/topometrics/topometrics.py"),
                "out": os.path.join(base, "../tools/topometrics/topometrics.py"),
            },
            {
                "in": os.path.join(base, "../TOOLS/topoMetrics"),
                "out": os.path.join(base, "../tools/topometrics"),
            },
            {
                "in": os.path.join(base, "../tools\\topoMetrics"),
                "out": os.path.join(base, "../tools/topometrics"),
            },
        ]
        # Test the normal case (we're catching warnings too)
        for testpath in testpaths:

            with mock.patch('lib.loghelper.Logger.warning') as ctx: