Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
4cfee008
Commit
4cfee008
authored
Sep 12, 2013
by
Mukund Sivaraman
Browse files
[3095] Assert that the main() function is called when passed to the traceback handler
parent
b1274061
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/python/isc/util/tests/traceback_handler_test.py
View file @
4cfee008
...
...
@@ -42,21 +42,27 @@ class TracebackHandlerTest(unittest.TestCase):
Test the handler doesn't influence the result of successful
function.
"""
self
.
called
=
False
def
succ
():
self
.
called
=
True
return
42
self
.
assertEqual
(
42
,
isc
.
util
.
traceback_handler
.
traceback_handler
(
succ
))
self
.
assertTrue
(
self
.
called
)
def
test_success_no_returned_value
(
self
):
"""
Test the handler handles the case where main() returns nothing.
"""
self
.
called
=
False
def
succ
():
self
.
called
=
True
return
self
.
assertEqual
(
None
,
isc
.
util
.
traceback_handler
.
traceback_handler
(
succ
))
self
.
assertTrue
(
self
.
called
)
def
test_exception
(
self
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment