summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-03 16:14:19 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-03 16:18:10 +0000
commitd0cae6b5a16a5873afbcd47ba8ee5e97b6a25072 (patch)
tree5b23a8e99dd3760b4dceb6a791986b77fc3627bb
parentf3a7149a85f78843422a1bf2c822ff8f47f08d7b (diff)
downloadnova-d0cae6b5a16a5873afbcd47ba8ee5e97b6a25072.tar.gz
nova-d0cae6b5a16a5873afbcd47ba8ee5e97b6a25072.tar.xz
nova-d0cae6b5a16a5873afbcd47ba8ee5e97b6a25072.zip
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
-rw-r--r--nova/tests/test_xenapi.py3
1 files changed, 2 insertions, 1 deletions
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()