# Path: tmapi/exceptions.py
# class MalformedIRIException (TMAPIRuntimeException):
# 
#     """Thrown to indicate that a malformed IRI has occurred."""
# 
#     def __init__ (self, message):
#         """Constructs a `MalformedIRIException` with the specified
#         detail message."""
#         super(MalformedIRIException, self).__init__(message)


from tmapi.exceptions import MalformedIRIException
from tmapi_test_case import TMAPITestCase
that come with the TMAPI 2.0 distribution (http://www.tmapi.org/2.0/).

"""




class LocatorTest (TMAPITestCase):

    def test_normalization (self):
        locator = self.tm.create_locator('http://www.example.org/test%20me/')
        self.assertEqual('http://www.example.org/test me/',
                         locator.get_reference())
        self.assertEqual('http://www.example.org/test%20me/',
                         locator.to_external_form())
        locator2 = locator.resolve('./too')
        self.assertEqual('http://www.example.org/test me/too',
                         locator2.get_reference());
        self.assertEqual('http://www.example.org/test%20me/too',
                         locator2.to_external_form())
        locator3 = self.tms.create_locator('http://www.example.org/test me/')
        self.assertEqual('http://www.example.org/test me/',
                         locator3.get_reference())
        self.assertEqual('http://www.example.org/test%20me/',
                         locator3.to_external_form())
        self.assertEqual(locator, locator3)

    def test_illegal_locator_addresses (self):
        illegal = ('', '#fragment')
        for address in illegal:

# Path: tmapi/exceptions.py
# class MalformedIRIException (TMAPIRuntimeException):
# 
#     """Thrown to indicate that a malformed IRI has occurred."""
# 
#     def __init__ (self, message):
#         """Constructs a `MalformedIRIException` with the specified
#         detail message."""
#         super(MalformedIRIException, self).__init__(message)


# Path: tmapi/tests/models/test_locator.py
from tmapi.exceptions import MalformedIRIException
from tmapi_test_case import TMAPITestCase

that come with the TMAPI 2.0 distribution (http://www.tmapi.org/2.0/).

"""




class LocatorTest (TMAPITestCase):

    def test_normalization (self):
        locator = self.tm.create_locator('http://www.example.org/test%20me/')
        self.assertEqual('http://www.example.org/test me/',
                         locator.get_reference())
        self.assertEqual('http://www.example.org/test%20me/',
                         locator.to_external_form())
        locator2 = locator.resolve('./too')
        self.assertEqual('http://www.example.org/test me/too',
                         locator2.get_reference());
        self.assertEqual('http://www.example.org/test%20me/too',
                         locator2.to_external_form())
        locator3 = self.tms.create_locator('http://www.example.org/test me/')
        self.assertEqual('http://www.example.org/test me/',
                         locator3.get_reference())
        self.assertEqual('http://www.example.org/test%20me/',
                         locator3.to_external_form())
        self.assertEqual(locator, locator3)

    def test_illegal_locator_addresses (self):
        illegal = ('', '#fragment')
        for address in illegal:

            self.assertRaises(MalformedIRIException, self.tms.create_locator,