Files
deb-murano/murano/tests/unit/dsl/meta/ExceptionHandling.yaml
Ekaterina Fedorova 26f486cc1d Move and rename functional tests
Now, functional tests would be located in murano/tests folder

Group all unit tests to the corresponding folder under tests

Run only unit tests in Opentack gate

Change-Id: I5ebea265fd7cdef7e77a47eedae40d23f91638d0
Partly-Closes-Bug: #1349383
2014-07-29 22:29:27 +04:00

56 lines
1.1 KiB
YAML

Name: ExceptionHandling
Methods:
testThrow:
Arguments:
- enum:
Contract: $.int().notNull()
Body:
Try:
- trace('enter try')
- $.doThrow($enum)
- trace('exit try')
Catch:
- With: exceptionName
As: e
Do:
- trace($e.message)
- With: anotherExceptionName
As: e
Do:
- trace($e.message)
- trace(rethrow)
- Rethrow:
- As: e
Do:
- trace('catch all')
- trace($e.message)
Else:
- trace('else section')
Finally:
- trace('finally section')
doThrow:
Arguments:
- enum:
Contract: $.int().notNull()
Body:
- Match:
1:
- Throw: exceptionName
Message: exception message
2:
- Throw: anotherExceptionName
Message: exception message 2
3:
- Throw: thirdExceptionName
Message: exception message 3
4:
- Return:
Value: $enum
testStackTrace:
Body:
raisePythonException()