Skip to content

Commit 49c73db

Browse files
committed
Exception string test
1 parent 6203ed2 commit 49c73db

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/exceptions_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import unittest
2+
from ubersmith_client.exceptions import UbersmithException
3+
4+
5+
class ExceptionTestTest(unittest.TestCase):
6+
7+
def test_UbersmithException_has_string_representation(self):
8+
ex = UbersmithException(code=42, message='Wubba Lubba Dub Dub')
9+
self.assertEquals("{0}".format(ex), "Error code 42 - message: Wubba Lubba Dub Dub")

ubersmith_client/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
1416
class UbersmithException(Exception):
1517
code = None
1618
message = None

0 commit comments

Comments
 (0)