# 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
            dt = self.get_datatype_aware()
        except NotImplementedError:
            return
        iri = 'http://www.example.org/'
        value = self.tm.create_locator(iri)
        dt.set_value(iri, self._xsd_any_uri)
        self.assertEqual(iri, dt.get_value())
        self.assertEqual(self._xsd_any_uri, dt.get_datatype())
        self.assertEqual(value, dt.locator_value())

    def test_user_datatype (self):
        try:
            dt = self.get_datatype_aware()
        except NotImplementedError:
            return
        datatype = self.tm.create_locator('http://www.example.org/datatype')
        value = 'Value'
        dt.set_value(value, datatype)
        self.assertEqual(datatype, dt.get_datatype())
        self.assertEqual(value, dt.get_value())

    def test_illegal_datatype (self):
        # This test is not applicable in Python.
        pass

    def test_illegal_string_value (self):
        try:
            dt = self.get_datatype_aware()
        except NotImplementedError:
            return

# 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/datatype_aware_abstract_tests.py
from tmapi.exceptions import ModelConstraintException
from tmapi_test_case import TMAPITestCase

            dt = self.get_datatype_aware()
        except NotImplementedError:
            return
        iri = 'http://www.example.org/'
        value = self.tm.create_locator(iri)
        dt.set_value(iri, self._xsd_any_uri)
        self.assertEqual(iri, dt.get_value())
        self.assertEqual(self._xsd_any_uri, dt.get_datatype())
        self.assertEqual(value, dt.locator_value())

    def test_user_datatype (self):
        try:
            dt = self.get_datatype_aware()
        except NotImplementedError:
            return
        datatype = self.tm.create_locator('http://www.example.org/datatype')
        value = 'Value'
        dt.set_value(value, datatype)
        self.assertEqual(datatype, dt.get_datatype())
        self.assertEqual(value, dt.get_value())

    def test_illegal_datatype (self):
        # This test is not applicable in Python.
        pass

    def test_illegal_string_value (self):
        try:
            dt = self.get_datatype_aware()
        except NotImplementedError:
            return

        self.assertRaises(ModelConstraintException, dt.set_value, None)