# Path: tmapi/exceptions.py
# class TopicMapExistsException (TMAPIException):
# 
#     """Exception thrown when an attempt is made to create a new
#     `TopicMap` under a storage address (an IRI) that is already
#     assigned to another `TopicMap` in the same `TopicMapSystem`."""
# 
#     pass


from tmapi.exceptions import TopicMapExistsException
from tmapi_test_case import TMAPITestCase
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Module containing tests for the TopicMapSystem module.

Most if not all of these tests are ported from the public domain tests
that come with the TMAPI 2.0 distribution (http://www.tmapi.org/2.0/).

"""



class TopicMapSystemTest (TMAPITestCase):

    def test_load (self):
        tm = self.tms.get_topic_map(self.default_locator)
        self.assertTrue(tm, 'TopicMap was not created in setUp or was not ' +
                        'retrieved')
        self.assertTrue(tm.get_id(), 'There is no identifier for TopicMap')
        self.assertEqual(self.tm.get_id(), tm.get_id())
        
    def test_same_locator (self):
        """Verify two TopicMaps can't be created with the same locator."""

# Path: tmapi/exceptions.py
# class TopicMapExistsException (TMAPIException):
# 
#     """Exception thrown when an attempt is made to create a new
#     `TopicMap` under a storage address (an IRI) that is already
#     assigned to another `TopicMap` in the same `TopicMapSystem`."""
# 
#     pass


# Path: tmapi/tests/models/test_topic_map_system.py
from tmapi.exceptions import TopicMapExistsException
from tmapi_test_case import TMAPITestCase

# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Module containing tests for the TopicMapSystem module.

Most if not all of these tests are ported from the public domain tests
that come with the TMAPI 2.0 distribution (http://www.tmapi.org/2.0/).

"""



class TopicMapSystemTest (TMAPITestCase):

    def test_load (self):
        tm = self.tms.get_topic_map(self.default_locator)
        self.assertTrue(tm, 'TopicMap was not created in setUp or was not ' +
                        'retrieved')
        self.assertTrue(tm.get_id(), 'There is no identifier for TopicMap')
        self.assertEqual(self.tm.get_id(), tm.get_id())
        
    def test_same_locator (self):
        """Verify two TopicMaps can't be created with the same locator."""

        self.assertRaises(TopicMapExistsException, self.tms.create_topic_map,