Merge "Fail test if excepted error was not raised"

This commit is contained in:
Jenkins 2016-09-30 22:20:54 +00:00 committed by Gerrit Code Review
commit 788657fcd9
1 changed files with 3 additions and 4 deletions

View File

@ -523,10 +523,9 @@ class DbNodeTestCase(base.DbTestCase):
r = 'fake-reservation'
self.dbapi.reserve_node(r, uuid)
try:
self.dbapi.reserve_node('another', uuid)
except exception.NodeLocked as e:
self.assertIn(r, str(e))
exc = self.assertRaises(exception.NodeLocked, self.dbapi.reserve_node,
'another', uuid)
self.assertIn(r, str(exc))
def test_reservation_non_existent_node(self):
node = utils.create_test_node()