# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter


from tmapi.exceptions import ModelConstraintException
from tmapi_test_case import TMAPITestCase

class ReifiableTest (TMAPITestCase):

    def _test_reification (self, reifiable):
        """Tests setting/getting the reifier for the `reifiable`.

        :param reifiable: the reifiable to run the tests against
        :type reifiable: `Reifiable`

        """
        self.assertEqual(None, reifiable.get_reifier(),
                         'Unexpected reifier property')
        reifier = self.create_topic()
        self.assertEqual(None, reifier.get_reified())
        reifiable.set_reifier(reifier)
        self.assertEqual(reifier, reifiable.get_reifier(),
                         'Unexpected reifier property')
        self.assertEqual(reifiable, reifier.get_reified(),
                         'Unexpected reified property')
        reifiable.set_reifier(None)
        self.assertEqual(None, reifiable.get_reifier(),
                         'Reifier should be None')
        self.assertEqual(None, reifier.get_reified(), 'Reified should be None')
        reifiable.set_reifier(reifier)
        self.assertEqual(reifier, reifiable.get_reifier(),
                         'Unexpected reifier property')
        self.assertEqual(reifiable, reifier.get_reified(),
                         'Unexpected reified property')
        try:
            reifiable.set_reifier(reifier)

# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter


# Path: tmapi/tests/models/test_reifiable.py
from tmapi.exceptions import ModelConstraintException
from tmapi_test_case import TMAPITestCase


class ReifiableTest (TMAPITestCase):

    def _test_reification (self, reifiable):
        """Tests setting/getting the reifier for the `reifiable`.

        :param reifiable: the reifiable to run the tests against
        :type reifiable: `Reifiable`

        """
        self.assertEqual(None, reifiable.get_reifier(),
                         'Unexpected reifier property')
        reifier = self.create_topic()
        self.assertEqual(None, reifier.get_reified())
        reifiable.set_reifier(reifier)
        self.assertEqual(reifier, reifiable.get_reifier(),
                         'Unexpected reifier property')
        self.assertEqual(reifiable, reifier.get_reified(),
                         'Unexpected reified property')
        reifiable.set_reifier(None)
        self.assertEqual(None, reifiable.get_reifier(),
                         'Reifier should be None')
        self.assertEqual(None, reifier.get_reified(), 'Reified should be None')
        reifiable.set_reifier(reifier)
        self.assertEqual(reifier, reifiable.get_reifier(),
                         'Unexpected reifier property')
        self.assertEqual(reifiable, reifier.get_reified(),
                         'Unexpected reified property')
        try:
            reifiable.set_reifier(reifier)

        except ModelConstraintException: