# 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
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
"""Exception test classes for djangolg."""

from __future__ import print_function
from __future__ import unicode_literals




class ExceptionTestCase(TestCase):
    """Test djangolg custom 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():

# 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

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
"""Exception test classes for djangolg."""

from __future__ import print_function
from __future__ import unicode_literals




class ExceptionTestCase(TestCase):
    """Test djangolg custom 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)