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

View File

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