# Path: tmapi/constants.py
# XSD_ANY_URI = XSD + 'anyURI'
# 
# 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.constants import XSD_ANY_URI
from tmapi.exceptions import ModelConstraintException
from tmapi_test_case import TMAPITestCase
        self.assertTrue(name in parent.get_names(),
                        'Name is not part of get_names()')
        name.remove()
        self.assertEqual(0, parent.get_names().count(),
                         'Expected name list size to decrement for topic')

    def test_value (self):
        value1 = 'TMAPI Name'
        value2 = 'A name'
        name = self.create_name()
        name.set_value(value1)
        self.assertEqual(value1, name.get_value())
        name.set_value(value2)
        self.assertEqual(value2, name.get_value())
        self.assertRaises(ModelConstraintException, name.set_value, None)

    def test_variant_creation_string (self):
        name = self.create_name()
        theme = self.create_topic()
        xsd_string = self.create_locator(
            'http://www.w3.org/2001/XMLSchema#string')
        variant = name.create_variant('Variant', [theme])
        self.assertEqual('Variant', variant.get_value())
        self.assertEqual(xsd_string, variant.get_datatype())
        self.assertEqual(1, variant.get_scope().count())
        self.assertTrue(theme in variant.get_scope())

    def test_variant_creation_uri (self):
        name = self.create_name()
        theme = self.create_topic()

# Path: tmapi/constants.py
# XSD_ANY_URI = XSD + 'anyURI'
# 
# 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_name.py
from tmapi.constants import XSD_ANY_URI
from tmapi.exceptions import ModelConstraintException
from tmapi_test_case import TMAPITestCase

        self.assertTrue(name in parent.get_names(),
                        'Name is not part of get_names()')
        name.remove()
        self.assertEqual(0, parent.get_names().count(),
                         'Expected name list size to decrement for topic')

    def test_value (self):
        value1 = 'TMAPI Name'
        value2 = 'A name'
        name = self.create_name()
        name.set_value(value1)
        self.assertEqual(value1, name.get_value())
        name.set_value(value2)
        self.assertEqual(value2, name.get_value())
        self.assertRaises(ModelConstraintException, name.set_value, None)

    def test_variant_creation_string (self):
        name = self.create_name()
        theme = self.create_topic()
        xsd_string = self.create_locator(
            'http://www.w3.org/2001/XMLSchema#string')
        variant = name.create_variant('Variant', [theme])
        self.assertEqual('Variant', variant.get_value())
        self.assertEqual(xsd_string, variant.get_datatype())
        self.assertEqual(1, variant.get_scope().count())
        self.assertTrue(theme in variant.get_scope())

    def test_variant_creation_uri (self):
        name = self.create_name()
        theme = self.create_topic()

        xsd_any_uri = self.create_locator(XSD_ANY_URI)