aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/catches_strings_runme.py
blob: 95b55a264688984eea1a21a48ca1641415742456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from catches_strings import *

exception_thrown = False
try:
    StringsThrower.charstring()
except RuntimeError as e:
    if "charstring message" not in str(e):
        raise RuntimeError("incorrect exception message:" + str(e))
    exception_thrown = True
if not exception_thrown:
    raise RuntimeError("Should have thrown an exception")

exception_thrown = False
try:
    StringsThrower.stdstring()
except RuntimeError as e:
    if "stdstring message" not in str(e):
        raise RuntimeError("incorrect exception message:" + str(e))
    exception_thrown = True
if not exception_thrown:
    raise RuntimeError("Should have thrown an exception")