# Path: jasper/exceptions.py
# class ExpectationException(Exception):
#     """
#     An Exception that is thrown when an expectation fails in the Expect class.
#     """
#     def __init__(self, actual, expected, operator):
#         """
#         Initialize this ExpectationException object.
# 
#         :param actual: The actual data used during the expectation.
#         :param expected: The expected data used during the expectation.
#         :param operator: The operator used during the expectation.
#         """
#         super().__init__()
#         self.actual = actual
#         self.expected = expected
#         self.operator = operator
# 
#     def __str__(self):
#         return f'FAILURE: Expected {self.actual} {self.operator} {self.expected}'
# 
# class ValidationException(Exception):
#     """
#     An Exception that is thrown when an object fails validation during construction.
#     """
#     pass


from unittest import TestCase
from jasper.exceptions import ExpectationException, ValidationException


class ExpectationExceptionTestCase(TestCase):

    def test_init(self):
        expectation_exception = ExpectationException('foo', 'bar', 'some_operator')

        self.assertTrue(isinstance(expectation_exception, Exception))
        self.assertEqual(expectation_exception.actual, 'foo')
        self.assertEqual(expectation_exception.expected, 'bar')
        self.assertEqual(expectation_exception.operator, 'some_operator')

    def test_str(self):
        expectation_exception = ExpectationException('foo', 'bar', 'some_operator')

        self.assertEqual(str(expectation_exception), 'FAILURE: Expected foo some_operator bar')

    def test_raise(self):
        with self.assertRaises(ExpectationException):
            raise ExpectationException('foo', 'bar', 'some_operator')


class ValidationExceptionTestCase(TestCase):

    def test_init(self):

# Path: jasper/exceptions.py
# class ExpectationException(Exception):
#     """
#     An Exception that is thrown when an expectation fails in the Expect class.
#     """
#     def __init__(self, actual, expected, operator):
#         """
#         Initialize this ExpectationException object.
# 
#         :param actual: The actual data used during the expectation.
#         :param expected: The expected data used during the expectation.
#         :param operator: The operator used during the expectation.
#         """
#         super().__init__()
#         self.actual = actual
#         self.expected = expected
#         self.operator = operator
# 
#     def __str__(self):
#         return f'FAILURE: Expected {self.actual} {self.operator} {self.expected}'
# 
# class ValidationException(Exception):
#     """
#     An Exception that is thrown when an object fails validation during construction.
#     """
#     pass


# Path: tests/test_unit/test_exceptions.py
from unittest import TestCase
from jasper.exceptions import ExpectationException, ValidationException



class ExpectationExceptionTestCase(TestCase):

    def test_init(self):
        expectation_exception = ExpectationException('foo', 'bar', 'some_operator')

        self.assertTrue(isinstance(expectation_exception, Exception))
        self.assertEqual(expectation_exception.actual, 'foo')
        self.assertEqual(expectation_exception.expected, 'bar')
        self.assertEqual(expectation_exception.operator, 'some_operator')

    def test_str(self):
        expectation_exception = ExpectationException('foo', 'bar', 'some_operator')

        self.assertEqual(str(expectation_exception), 'FAILURE: Expected foo some_operator bar')

    def test_raise(self):
        with self.assertRaises(ExpectationException):
            raise ExpectationException('foo', 'bar', 'some_operator')


class ValidationExceptionTestCase(TestCase):

    def test_init(self):

        validation_exception = ValidationException()