Exemplo n.º 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=[]
     )
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 4
0
def federation_post_data(**kw):
    federation = utils.get_test_federation(**kw)
    internal = federation_controller.FederationPatchType.internal_attrs()
    return remove_internal(federation, internal)
Exemplo n.º 5
0
 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()
Exemplo n.º 6
0
def federation_post_data(**kw):
    federation = utils.get_test_federation(**kw)
    internal = federation_controller.FederationPatchType.internal_attrs()
    return remove_internal(federation, internal)
Exemplo n.º 7
0
 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()