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 <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-04-24 14:37:39 +05:30
parent 403f7b5b87
commit 762977d7c6
3 changed files with 22 additions and 22 deletions

View File

@ -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]
)

View File

@ -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"
)

View File

@ -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)