From d3f75618e7aeca5586d494c217ad5b6d3dcfd3c2 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Mon, 11 Aug 2014 04:10:14 -0700 Subject: [PATCH] CLOUDSTACK-7304: Fixed Exception not raised issue in portable IP test cases Signed-off-by: Santhosh Edukulla --- .../integration/component/test_portable_ip.py | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index b9c9059d2b8..73aa7c0ed98 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -1218,8 +1218,7 @@ class TestDeleteAccount(cloudstackTestCase): # 2. Delete account # 3. Account should get deleted successfully - try: - portableip = PublicIPAddress.create( + portableip = PublicIPAddress.create( self.apiclient, accountid=self.account.name, zoneid=self.zone.id, @@ -1227,12 +1226,10 @@ class TestDeleteAccount(cloudstackTestCase): networkid=self.network.id, isportable=True ) - self.account.delete(self.apiclient) - with self.assertRaises(Exception): - PublicIPAddress.list(self.apiclient, - id=portableip.ipaddress.id) - except Exception as e: - self.fail(e) + self.account.delete(self.apiclient) + list_publicips = PublicIPAddress.list(self.apiclient, + id=portableip.ipaddress.id) + self.assertEqual(list_publicips, None, "List of ip addresses should be empty") return @attr(tags=["advanced", "selfservice"]) @@ -1313,10 +1310,9 @@ class TestDeleteAccount(cloudstackTestCase): self.debug("Trying to list the ip address associated with deleted account, \ should throw exception") - with self.assertRaises(Exception): - PublicIPAddress.list(self.apiclient, - id=portableip.ipaddress.id) - + list_publicips = PublicIPAddress.list(self.apiclient, + id=portableip.ipaddress.id) + self.assertEqual(list_publicips, None, "List of ip addresses should be empty") return class TestPortableIpTransferAcrossNetworks(cloudstackTestCase):