marvin_refactor: always check for complete object identity with json Remove check which ensured single key match for the json result with the object response. This would return ipaddressResponse.ipaddress as a nested object whereas the response itself is the ipaddress
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/dab5ae5e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/dab5ae5e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/dab5ae5e Branch: refs/heads/marvin-refactor Commit: dab5ae5e14c787ca56373c75cbab7ee6db336fcf Parents: 9afab98 Author: Prasanna Santhanam <[email protected]> Authored: Wed Sep 18 14:31:20 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Wed Oct 2 20:27:57 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/jsonHelper.py | 4 ---- tools/marvin/marvin/test/test_factories.py | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dab5ae5e/tools/marvin/marvin/jsonHelper.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/jsonHelper.py b/tools/marvin/marvin/jsonHelper.py index 605e06f..a395e6b 100644 --- a/tools/marvin/marvin/jsonHelper.py +++ b/tools/marvin/marvin/jsonHelper.py @@ -113,10 +113,6 @@ def finalizeResultObj(result, responseName, responsecls): responsecls) return result elif responsecls is not None: - for k, v in result.__dict__.iteritems(): - if k in responsecls.__dict__: - return result - attr = result.__dict__.keys()[0] value = getattr(result, attr) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dab5ae5e/tools/marvin/marvin/test/test_factories.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/test/test_factories.py b/tools/marvin/marvin/test/test_factories.py index 89d67fb..6a09303 100644 --- a/tools/marvin/marvin/test/test_factories.py +++ b/tools/marvin/marvin/test/test_factories.py @@ -229,11 +229,9 @@ class IpAddressFactoryTest(unittest.TestCase): account=accnt.name, domainid=accnt.domainid) - all_ips = IpAddress.listPublic(apiclient=self.apiClient) - firstip = all_ips[0] networks = Network.list(apiclient=self.apiClient, account = accnt.name, domainid = accnt.domainid) - firstip.associate(apiclient=self.apiClient, networkid = networks[0].id) + IpAddress(apiclient=self.apiClient, networkid = networks[0].id) class FirewallRuleFactoryTest(unittest.TestCase): @@ -280,7 +278,7 @@ class FirewallRuleFactoryTest(unittest.TestCase): fwrule = SshFirewallRuleFactory( apiclient=self.apiClient, - ipaddressid=ipaddress.ipaddress.id + ipaddressid=ipaddress.id ) fwrule |should_not| be(None) fwrule |should| be_instance_of(Firewall)
