cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [2/3] update the entity dict but not through optional kwargs
Date Tue, 19 Mar 2013 12:44:48 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/Tags.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Tags.py b/tools/marvin/marvin/integration/lib/base/Tags.py
index e51043b..e044a41 100644
--- a/tools/marvin/marvin/integration/lib/base/Tags.py
+++ b/tools/marvin/marvin/integration/lib/base/Tags.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import deleteTags
 class Tags(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/Template.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Template.py b/tools/marvin/marvin/integration/lib/base/Template.py
index 85ef6a7..e839c14 100644
--- a/tools/marvin/marvin/integration/lib/base/Template.py
+++ b/tools/marvin/marvin/integration/lib/base/Template.py
@@ -27,8 +27,8 @@ from marvin.cloudstackAPI import deleteTemplate
 class Template(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def prepare(self, apiclient, zoneid, templateid, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py b/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
index a6a240a..0fc4401 100644
--- a/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
+++ b/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
@@ -21,8 +21,8 @@ from marvin.cloudstackAPI import updateTemplatePermissions
 class TemplatePermissions(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
index 52bb579..58fcf04 100644
--- a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
@@ -20,8 +20,8 @@ from marvin.cloudstackAPI import assignToLoadBalancerRule
 class ToLoadBalancerRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def assign(self, apiclient, id, virtualmachineids, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py b/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
index 164fec4..4770f8b 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import deleteTrafficMonitor
 class TrafficMonitor(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def add(self, apiclient, url, zoneid, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/TrafficType.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficType.py b/tools/marvin/marvin/integration/lib/base/TrafficType.py
index 7fe101a..7a14083 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficType.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficType.py
@@ -23,8 +23,8 @@ from marvin.cloudstackAPI import deleteTrafficType
 class TrafficType(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def add(self, apiclient, traffictype, physicalnetworkid, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py b/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
index d5e23ad..36b3ebc 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
@@ -20,8 +20,8 @@ from marvin.cloudstackAPI import listTrafficTypeImplementors
 class TrafficTypeImplementors(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/UsageRecords.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UsageRecords.py b/tools/marvin/marvin/integration/lib/base/UsageRecords.py
index 1bd1765..8eb2c82 100644
--- a/tools/marvin/marvin/integration/lib/base/UsageRecords.py
+++ b/tools/marvin/marvin/integration/lib/base/UsageRecords.py
@@ -21,8 +21,8 @@ from marvin.cloudstackAPI import generateUsageRecords
 class UsageRecords(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/UsageTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UsageTypes.py b/tools/marvin/marvin/integration/lib/base/UsageTypes.py
index 0c73f3b..d0e8dcd 100644
--- a/tools/marvin/marvin/integration/lib/base/UsageTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/UsageTypes.py
@@ -20,8 +20,8 @@ from marvin.cloudstackAPI import listUsageTypes
 class UsageTypes(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/User.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/User.py b/tools/marvin/marvin/integration/lib/base/User.py
index 25ac70d..bc84761 100644
--- a/tools/marvin/marvin/integration/lib/base/User.py
+++ b/tools/marvin/marvin/integration/lib/base/User.py
@@ -27,8 +27,8 @@ from marvin.cloudstackAPI import deleteUser
 class User(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def enable(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/UserKeys.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UserKeys.py b/tools/marvin/marvin/integration/lib/base/UserKeys.py
index 09116e8..85433c1 100644
--- a/tools/marvin/marvin/integration/lib/base/UserKeys.py
+++ b/tools/marvin/marvin/integration/lib/base/UserKeys.py
@@ -20,8 +20,8 @@ from marvin.cloudstackAPI import registerUserKeys
 class UserKeys(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def register(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VMPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMPassword.py b/tools/marvin/marvin/integration/lib/base/VMPassword.py
index 5a6f797..78cb4f1 100644
--- a/tools/marvin/marvin/integration/lib/base/VMPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/VMPassword.py
@@ -20,8 +20,8 @@ from marvin.cloudstackAPI import getVMPassword
 class VMPassword(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def get(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
index f04a9ac..e31710a 100644
--- a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import deleteVMSnapshot
 class VMSnapshot(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VPC.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPC.py b/tools/marvin/marvin/integration/lib/base/VPC.py
index 4e31fbe..770a737 100644
--- a/tools/marvin/marvin/integration/lib/base/VPC.py
+++ b/tools/marvin/marvin/integration/lib/base/VPC.py
@@ -24,8 +24,8 @@ from marvin.cloudstackAPI import deleteVPC
 class VPC(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VPCOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPCOffering.py b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
index 3afa7fd..71557f7 100644
--- a/tools/marvin/marvin/integration/lib/base/VPCOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
@@ -23,8 +23,8 @@ from marvin.cloudstackAPI import deleteVPCOffering
 class VPCOffering(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
index c4bf052..ba79d33 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
@@ -29,8 +29,8 @@ from marvin.cloudstackAPI import assignVirtualMachine
 class VirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def restore(self, apiclient, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
index b811e7d..325d669 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import configureVirtualRouterElement
 class VirtualRouterElement(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
index ed79f5d..8e134f3 100644
--- a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import deleteVlanIpRange
 class VlanIpRange(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/Volume.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Volume.py b/tools/marvin/marvin/integration/lib/base/Volume.py
index 0bd3b3d..be9731a 100644
--- a/tools/marvin/marvin/integration/lib/base/Volume.py
+++ b/tools/marvin/marvin/integration/lib/base/Volume.py
@@ -27,8 +27,8 @@ from marvin.cloudstackAPI import deleteVolume
 class Volume(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def migrate(self, apiclient, storageid, volumeid, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VpnConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnConnection.py b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
index fbb96f3..d43c27b 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnConnection.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
@@ -23,8 +23,8 @@ from marvin.cloudstackAPI import deleteVpnConnection
 class VpnConnection(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def reset(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
index 61c6749..49d746c 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
@@ -23,8 +23,8 @@ from marvin.cloudstackAPI import deleteVpnCustomerGateway
 class VpnCustomerGateway(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VpnGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnGateway.py b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
index ef9a8e7..e929937 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import deleteVpnGateway
 class VpnGateway(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/VpnUser.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnUser.py b/tools/marvin/marvin/integration/lib/base/VpnUser.py
index 387352f..d060a9d 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnUser.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnUser.py
@@ -22,8 +22,8 @@ from marvin.cloudstackAPI import removeVpnUser
 class VpnUser(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     def add(self, apiclient, username, password, **kwargs):

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/base/Zone.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Zone.py b/tools/marvin/marvin/integration/lib/base/Zone.py
index d895e64..42a632c 100644
--- a/tools/marvin/marvin/integration/lib/base/Zone.py
+++ b/tools/marvin/marvin/integration/lib/base/Zone.py
@@ -23,8 +23,8 @@ from marvin.cloudstackAPI import deleteZone
 class Zone(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, **kwargs):
-        self.__dict__.update(**kwargs)
+    def __init__(self, items):
+        self.__dict__.update(items)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py b/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
index dc543d4..ebff3fe 100644
--- a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
@@ -25,10 +25,10 @@ class AccountFactory(CloudStackBaseFactory):
     FACTORY_FOR = Account.Account
 
     accounttype = 0
+    firstname = factory.Sequence(lambda n: random_gen())
+    lastname = factory.Sequence(lambda n: random_gen())
     email = factory.LazyAttribute(lambda e: '{0}.{1}@cloudstack.org'.format(e.firstname,
e.lastname).lower())
-    firstname = 'fname-'+random_gen()
-    lastname = 'lname-'+random_gen()
-    username = firstname + lastname
+    username = factory.Sequence(lambda n: random_gen())
 
     # Password Encoding
     mdf = hashlib.md5()

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/factory/CloudStackBaseFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/CloudStackBaseFactory.py b/tools/marvin/marvin/integration/lib/factory/CloudStackBaseFactory.py
index a921430..76e5c81 100644
--- a/tools/marvin/marvin/integration/lib/factory/CloudStackBaseFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/CloudStackBaseFactory.py
@@ -22,4 +22,6 @@ class CloudStackBaseFactory(factory.Factory):
 
     @classmethod
     def _create(cls, target_class, *args, **kwargs):
+        if len(args) == 0:
+            return target_class(kwargs)
         return target_class(*args, **kwargs)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index 9572df5..12369c2 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -28,16 +28,19 @@ class AccountFactoryTest(unittest.TestCase):
         af = AccountFactory.AccountFactory()
         accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
+        self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
     def test_adminAccountFactory(self):
         af = AccountFactory.AccountFactory()
         accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
+        self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
     def test_userAccountFactoryCustomArgs(self):
         af = AccountFactory.AccountFactory(firstname='test', lastname='test')
         accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
+        self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
     def tearDown(self):
         pass

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8a0c143/tools/marvin/marvin/integration/lib/generateBase.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/generateBase.py b/tools/marvin/marvin/integration/lib/generateBase.py
index c34a52a..d22578d 100644
--- a/tools/marvin/marvin/integration/lib/generateBase.py
+++ b/tools/marvin/marvin/integration/lib/generateBase.py
@@ -116,8 +116,8 @@ def write_entity_classes(entities):
         imports.append('from marvin.integration.lib.base import CloudStackEntity')
         body.append('class %s(CloudStackEntity.CloudStackEntity):'%entity)
         body.append('\n')
-        body.append(tabspace + 'def __init__(self, **kwargs):')
-        body.append(tabspace*2 + 'self.__dict__.update(**kwargs)')
+        body.append(tabspace + 'def __init__(self, items):')
+        body.append(tabspace*2 + 'self.__dict__.update(items)')
         body.append('\n')
         for action, details in actions.iteritems():
             imports.append('from marvin.cloudstackAPI import %s'%details['apimodule'])


Mime
View raw message