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
Sebastian Schrader
Kea
Commits
366f210b
Commit
366f210b
authored
Dec 10, 2012
by
Mukund Sivaraman
Browse files
[2353] Use assertRaises() instead of the excessive code
parent
e6ebe1de
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bind10/tests/bind10_test.py.in
View file @
366f210b
...
...
@@ -1791,16 +1791,11 @@ class TestBossComponents(unittest.TestCase):
attempts += 1
time.sleep = _my_sleep
thrown = False
# An exception will be thrown here when it eventually times out.
try:
pi = bob.start_cfgmgr()
except bind10_src.ProcessStartError as e:
thrown = True
# We just check that an exception was thrown, and that several
# attempts were made to connect.
self.assertTrue(thrown)
with self.assertRaises(bind10_src.ProcessStartError):
pi = bob.start_cfgmgr()
# 2 seconds of attempts every 1 second should result in 2 attempts
self.assertEqual(attempts, 2)
...
...
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