# Path: djangolg/exceptions.py
# DEFAULT_EVENT = events.EVENT_QUERY_ERROR
# DEFAULT_STATUS = 500
# DEFAULT_REASON = "An unhandled error occured. \
#                   Please try again or contact support."
# class LookingGlassError(Exception):
# class TypeCheckError(TypeError):
#     def log_error(self):
# def check_type(instance=None, classinfo=None):
# def default_error_message(e=None):


from django.test import TestCase
from djangolg import exceptions

    def test_type_check_helper(self):
        """Test check_type helper."""
        class DummyClass(object): # noqa
            """A dummy class for testing purposes."""
            pass
        class DummySubClass(DummyClass): # noqa
            """A dummy subclass for testing purposes."""
            pass
        # these checks should pass
        pass_dict = {
            (0,): tuple, 0: int,
            DummyClass: type, DummySubClass(): DummyClass,
        }
        for instance, classinfo in pass_dict.items():
            exceptions.check_type(instance=instance, classinfo=classinfo)
        # these should fail
        fail_dict = {
            (0,): list, 0: str,
            DummySubClass: DummyClass, DummyClass(): DummySubClass,
        }
        for instance, classinfo in fail_dict.items():
            try:
                exceptions.check_type(instance=instance, classinfo=classinfo)
            except Exception as e:
                assert isinstance(e, exceptions.TypeCheckError)

    def test_default_error_message(self):
        """Test default_error_message helper."""
        test_string = "default message string"

# Path: djangolg/exceptions.py
# DEFAULT_EVENT = events.EVENT_QUERY_ERROR
# DEFAULT_STATUS = 500
# DEFAULT_REASON = "An unhandled error occured. \
#                   Please try again or contact support."
# class LookingGlassError(Exception):
# class TypeCheckError(TypeError):
#     def log_error(self):
# def check_type(instance=None, classinfo=None):
# def default_error_message(e=None):


# Path: tests/test_exceptions.py
from django.test import TestCase
from djangolg import exceptions


    def test_type_check_helper(self):
        """Test check_type helper."""
        class DummyClass(object): # noqa
            """A dummy class for testing purposes."""
            pass
        class DummySubClass(DummyClass): # noqa
            """A dummy subclass for testing purposes."""
            pass
        # these checks should pass
        pass_dict = {
            (0,): tuple, 0: int,
            DummyClass: type, DummySubClass(): DummyClass,
        }
        for instance, classinfo in pass_dict.items():
            exceptions.check_type(instance=instance, classinfo=classinfo)
        # these should fail
        fail_dict = {
            (0,): list, 0: str,
            DummySubClass: DummyClass, DummyClass(): DummySubClass,
        }
        for instance, classinfo in fail_dict.items():
            try:
                exceptions.check_type(instance=instance, classinfo=classinfo)
            except Exception as e:
                assert isinstance(e, exceptions.TypeCheckError)

    def test_default_error_message(self):
        """Test default_error_message helper."""
        test_string = "default message string"

        exc = exceptions.LookingGlassError(test_string)