CLOUDSTACK-3618: When project account does not exist, API now throws exception
API call listprojectaccounts failed, and test case test_projects.py:test_08_cleanup_after_project_delete failed due to this Signed-off-by: Prasanna Santhanam <[email protected]> (cherry picked from commit 52fa8532bb2821f9b5472e713a905bc6b7f712b5) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d52d2c85 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d52d2c85 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d52d2c85 Branch: refs/heads/master Commit: d52d2c850591d169f6b3cf7d9596965fd16ad1f8 Parents: b4662af Author: Sanjay Tripathi <[email protected]> Authored: Thu Jul 18 14:35:33 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Thu Jul 18 15:05:56 2013 +0530 ---------------------------------------------------------------------- test/integration/component/test_projects.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d52d2c85/test/integration/component/test_projects.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index 39e9bee..68964e8 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -1431,13 +1431,10 @@ class TestProjectResources(cloudstackTestCase): "Resources (volume) should be deleted as part of cleanup" ) - accounts = Project.listAccounts(self.apiclient, projectid=project.id) - - self.assertEqual( - accounts, - None, - "Accounts should be un-assigned from project" - ) + # Accounts should be un-assigned from project, + # so this call will raise an exception: Unable to find the project id= + with self.assertRaises(Exception): + Project.listAccounts(self.apiclient, projectid=project.id) return
