Beispiel #1
0
 def setUp(self):
     super(TestFederationObject, self).setUp()
     self.fake_federation = utils.get_test_federation(
         uuid=uuidutils.generate_uuid(),
         hostcluster_id=uuidutils.generate_uuid(),
         member_ids=[]
     )
Beispiel #2
0
def get_test_federation(context, **kw):
    """Return a Federation object with appropriate attributes.

    NOTE: The object leaves the attributes marked as changed, such
    that a create() could be used to commit it to the DB.
    """
    db_federation = db_utils.get_test_federation(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del db_federation['id']
    federation = objects.Federation(context)
    for key in db_federation:
        setattr(federation, key, db_federation[key])
    return federation
Beispiel #3
0
def get_test_federation(context, **kw):
    """Return a Federation object with appropriate attributes.

    NOTE: The object leaves the attributes marked as changed, such
    that a create() could be used to commit it to the DB.
    """
    db_federation = db_utils.get_test_federation(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del db_federation['id']
    federation = objects.Federation(context)
    for key in db_federation:
        setattr(federation, key, db_federation[key])
    return federation
Beispiel #4
0
def federation_post_data(**kw):
    federation = utils.get_test_federation(**kw)
    internal = federation_controller.FederationPatchType.internal_attrs()
    return remove_internal(federation, internal)
 def setUp(self):
     super(TestHandler, self).setUp()
     self.handler = federation_conductor.Handler()
     federation_dict = utils.get_test_federation()
     self.federation = objects.Federation(self.context, **federation_dict)
     self.federation.create()
Beispiel #6
0
def federation_post_data(**kw):
    federation = utils.get_test_federation(**kw)
    internal = federation_controller.FederationPatchType.internal_attrs()
    return remove_internal(federation, internal)
 def setUp(self):
     super(TestHandler, self).setUp()
     self.handler = federation_conductor.Handler()
     federation_dict = utils.get_test_federation()
     self.federation = objects.Federation(self.context, **federation_dict)
     self.federation.create()