@@ -0,0 +1,2263 @@
+# Copyright (c) 2016 AT&T Corp%0A# All Rights Reserved.%0A#%0A#    Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A#    not use this file except in compliance with the License. You may obtain%0A#    a copy of the License at%0A#%0A#         http://www.apache.org/licenses/LICENSE-2.0%0A#%0A#    Unless required by applicable law or agreed to in writing, software%0A#    distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A#    License for the specific language governing permissions and limitations%0A#    under the License.%0A%0Aimport six%0A%0Afrom murano.packages import exceptions%0Aimport murano.tests.unit.base as test_base%0A%0A%0Aclass TestExceptions(test_base.MuranoTestCase):%0A%0A    def test_package_class_load_error(self):%0A        class_name = 'test class name'%0A        message = 'test message'%0A        error = exceptions.PackageClassLoadError(class_name=class_name,%0A                                                 message=message)%0A        expected = 'Unable to load class %22%7B0%7D%22 from package: %7B1%7D'%5C%0A                   .format(class_name, message)%0A        if six.PY2:%0A            self.assertEqual(expected, error.message)%0A        elif six.PY34:%0A            self.assertEqual(expected, error.args%5B0%5D)%0A%0A    def test_package_ui_load_error(self):%0A        messages = %5B'', 'test_message'%5D%0A        for message in messages:%0A            error = exceptions.PackageUILoadError(message=message)%0A            expected = 'Unable to load ui definition from package'%0A            if message:%0A                expected += ': %7B0%7D'.format(message)%0A            if six.PY2:%0A                self.assertEqual(expected, error.message)%0A            elif six.PY34:%0A                self.assertEqual(expected, error.args%5B0%5D)%0A%0A    def test_package_format_error(self):%0A        messages = %5B'', 'test_message'%5D%0A        for message in messages:%0A            error = exceptions.PackageFormatError(message=message)%0A            expected = 'Incorrect package format'%0A            if message:%0A                expected += ': %7B0%7D'.format(message)%0A            if six.PY2:%0A                self.assertEqual(expected, error.message)%0A            elif six.PY34:%0A                self.assertEqual(expected, error.args%5B0%5D)%0A

Increase unit test coverage for exceptions in Packages API.