]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
autoscaling test fix assertRaises Exception warning
authorSteven Hardy <shardy@redhat.com>
Fri, 30 Aug 2013 10:25:33 +0000 (11:25 +0100)
committerSteven Hardy <shardy@redhat.com>
Fri, 30 Aug 2013 10:25:33 +0000 (11:25 +0100)
Fix "H202 assertRaises Exception too broad" warning

Change-Id: I162dbd8e421b22cbf3a55b7052107c8332b8d59a

heat/tests/test_autoscaling.py

index caaa393a55b3d48ed1e4b5709722f31df94f6950..be5884fc69891e5fbb3b51dfe7e7c3274af33127 100644 (file)
@@ -775,12 +775,12 @@ class AutoScalingTest(HeatTestCase):
 
         # Scale up one 1 instance with resource failure
         self.m.StubOutWithMock(instance.Instance, 'handle_create')
-        instance.Instance.handle_create().AndRaise(Exception)
+        instance.Instance.handle_create().AndRaise(exception.Error())
         self._stub_lb_reload(1, unset=False, nochange=True)
         self._stub_validate()
         self.m.ReplayAll()
 
-        self.assertRaises(Exception, rsrc.adjust, 1)
+        self.assertRaises(exception.Error, rsrc.adjust, 1)
         self.assertEqual(['WebServerGroup-0'], rsrc.get_instance_names())
 
         self.m.VerifyAll()