From d0cae6b5a16a5873afbcd47ba8ee5e97b6a25072 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Sat, 3 Mar 2012 16:14:19 +0000 Subject: Fix test_unrescue to actually test unrescue Another case where assertRaises(Exception, ...) masked a bug in the unit test. The unrescue method takes another argument now. When TypeError was raised, it was caught by the broad match to Exception as well. Change-Id: I6b948baa41f2061ea413e14ae6aba054e6f22ecf --- nova/tests/test_xenapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 6f8ad189b..fb932d4a4 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -717,7 +717,8 @@ class XenAPIVMTestCase(test.TestCase): instance = self._create_instance() conn = xenapi_conn.get_connection(False) # Ensure that it will not unrescue a non-rescued instance. - self.assertRaises(Exception, conn.unrescue, instance) + self.assertRaises(exception.InstanceNotInRescueMode, conn.unrescue, + instance, None) def test_finish_revert_migration(self): instance = self._create_instance() -- cgit