Updated Branches:
  refs/heads/master 403f7b5b8 -> 762977d7c

Account object dereferences as account.name

Previously the jsonHelper would incorrectly deserialize the json
response if the object returned had an attribute of the same name
resulting in an additional level of indirection to refer to the entity's
attributes. eg: account.account.name instead of account.name

This fixes the tests that have still the same indirection exposed.

Signed-off-by: Prasanna Santhanam <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/762977d7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/762977d7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/762977d7

Branch: refs/heads/master
Commit: 762977d7c6f35c6f412dddc87a832a0bafc4db87
Parents: 403f7b5
Author: Prasanna Santhanam <[email protected]>
Authored: Wed Apr 24 14:37:39 2013 +0530
Committer: Prasanna Santhanam <[email protected]>
Committed: Wed Apr 24 14:42:44 2013 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_affinity_groups.py |   10 +++---
 test/integration/smoke/test_public_ip_range.py |    6 ++--
 test/integration/smoke/test_vm_life_cycle.py   |   28 +++++++++---------
 3 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/762977d7/test/integration/smoke/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_affinity_groups.py 
b/test/integration/smoke/test_affinity_groups.py
index 832c4a4..3ed3115 100644
--- a/test/integration/smoke/test_affinity_groups.py
+++ b/test/integration/smoke/test_affinity_groups.py
@@ -91,7 +91,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             domainid=cls.domain.id
         )
 
-        cls.services["account"] = cls.account.account.name
+        cls.services["account"] = cls.account.name
 
         cls.service_offering = ServiceOffering.create(
             cls.api_client,
@@ -120,8 +120,8 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             self.api_client,
             self.services["virtual_machine"],
             templateid=self.template.id,
-            accountid=self.account.account.name,
-            domainid=self.account.account.domainid,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
             serviceofferingid=self.service_offering.id,
             affinitygroupnames=[self.ag.name]
         )
@@ -153,8 +153,8 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             self.api_client,
             self.services["virtual_machine"],
             templateid=self.template.id,
-            accountid=self.account.account.name,
-            domainid=self.account.account.domainid,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
             serviceofferingid=self.service_offering.id,
             affinitygroupnames=[self.ag.name]
         )

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/762977d7/test/integration/smoke/test_public_ip_range.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_public_ip_range.py 
b/test/integration/smoke/test_public_ip_range.py
index 7c965ea..f2099ff 100644
--- a/test/integration/smoke/test_public_ip_range.py
+++ b/test/integration/smoke/test_public_ip_range.py
@@ -139,8 +139,8 @@ class TesDedicatePublicIPRange(cloudstackTestCase):
         dedicate_public_ip_range_response = PublicIpRange.dedicate(
                                                 self.apiclient,
                                                 self.public_ip_range.vlan.id,
-                                                
account=self.account.account.name,
-                                                
domainid=self.account.account.domainid
+                                                account=self.account.name,
+                                                domainid=self.account.domainid
                                             )
         list_public_ip_range_response = PublicIpRange.list(
                                             self.apiclient,
@@ -149,7 +149,7 @@ class TesDedicatePublicIPRange(cloudstackTestCase):
         public_ip_response = list_public_ip_range_response[0]
         self.assertEqual(
                             public_ip_response.account,
-                            self.account.account.name,
+                            self.account.name,
                             "Check account name is in listVlanIpRanges as the 
account public ip range is dedicated to"
                         )
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/762977d7/test/integration/smoke/test_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_life_cycle.py 
b/test/integration/smoke/test_vm_life_cycle.py
index cf9fd75..ae36c64 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -172,8 +172,8 @@ class TestDeployVM(cloudstackTestCase):
         cls.virtual_machine = VirtualMachine.create(
             cls.apiclient,
             cls.services["small"],
-            accountid=cls.account.account.name,
-            domainid=cls.account.account.domainid,
+            accountid=cls.account.name,
+            domainid=cls.account.domainid,
             serviceofferingid=cls.service_offering.id,
             mode=cls.services['mode']
         )
@@ -250,12 +250,12 @@ class TestDeployVM(cloudstackTestCase):
         3. Has a linklocalip, publicip and a guestip
         @return:
         """
-        routers = list_routers(self.apiclient, 
account=self.account.account.name)
+        routers = list_routers(self.apiclient, account=self.account.name)
         self.assertTrue(len(routers) > 0, msg = "No virtual router found")
         router = routers[0]
 
         self.assertEqual(router.state, 'Running', msg="Router is not in 
running state")
-        self.assertEqual(router.account, self.account.account.name, 
msg="Router does not belong to the account")
+        self.assertEqual(router.account, self.account.name, msg="Router does 
not belong to the account")
 
         #Has linklocal, public and guest ips
         self.assertIsNotNone(router.linklocalip, msg="Router has no linklocal 
ip")
@@ -271,12 +271,12 @@ class TestDeployVM(cloudstackTestCase):
         2. is in the account the VM was deployed in
         @return:
         """
-        routers = list_routers(self.apiclient, 
account=self.account.account.name)
+        routers = list_routers(self.apiclient, account=self.account.name)
         self.assertTrue(len(routers) > 0, msg = "No virtual router found")
         router = routers[0]
 
         self.assertEqual(router.state, 'Running', msg="Router is not in 
running state")
-        self.assertEqual(router.account, self.account.account.name, 
msg="Router does not belong to the account")
+        self.assertEqual(router.account, self.account.name, msg="Router does 
not belong to the account")
 
     def tearDown(self):
         pass
@@ -334,24 +334,24 @@ class TestVMLifeCycle(cloudstackTestCase):
         cls.small_virtual_machine = VirtualMachine.create(
                                         cls.api_client,
                                         cls.services["small"],
-                                        accountid=cls.account.account.name,
-                                        domainid=cls.account.account.domainid,
+                                        accountid=cls.account.name,
+                                        domainid=cls.account.domainid,
                                         
serviceofferingid=cls.small_offering.id,
                                         mode=cls.services["mode"]
                                         )
         cls.medium_virtual_machine = VirtualMachine.create(
                                        cls.api_client,
                                        cls.services["medium"],
-                                       accountid=cls.account.account.name,
-                                       domainid=cls.account.account.domainid,
+                                       accountid=cls.account.name,
+                                       domainid=cls.account.domainid,
                                        
serviceofferingid=cls.medium_offering.id,
                                        mode=cls.services["mode"]
                                     )
         cls.virtual_machine = VirtualMachine.create(
                                         cls.api_client,
                                         cls.services["small"],
-                                        accountid=cls.account.account.name,
-                                        domainid=cls.account.account.domainid,
+                                        accountid=cls.account.name,
+                                        domainid=cls.account.domainid,
                                         
serviceofferingid=cls.small_offering.id,
                                         mode=cls.services["mode"]
                                         )
@@ -939,8 +939,8 @@ class TestVMLifeCycle(cloudstackTestCase):
         iso = Iso.create(
                          self.apiclient,
                          self.services["iso"],
-                         account=self.account.account.name,
-                         domainid=self.account.account.domainid
+                         account=self.account.name,
+                         domainid=self.account.domainid
                          )
 
         self.debug("Successfully created ISO with ID: %s" % iso.id)

Reply via email to