diff --git a/tests/exceptions_test.py b/tests/exceptions_test.py new file mode 100644 index 0000000..affb3f1 --- /dev/null +++ b/tests/exceptions_test.py @@ -0,0 +1,9 @@ +import unittest +from ubersmith_client.exceptions import UbersmithException + + +class ExceptionTestTest(unittest.TestCase): + + def test_UbersmithException_has_string_representation(self): + ex = UbersmithException(code=42, message='Wubba Lubba Dub Dub') + self.assertEquals("{0}".format(ex), "Error code 42 - message: Wubba Lubba Dub Dub") diff --git a/ubersmith_client/exceptions.py b/ubersmith_client/exceptions.py index 090ee43..bfb0fd5 100644 --- a/ubersmith_client/exceptions.py +++ b/ubersmith_client/exceptions.py @@ -11,6 +11,8 @@ # 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. + + class UbersmithException(Exception): code = None message = None