Ejemplo n.º 1
0
 def _make_object(self, fields):
     fields = obj_test_base.get_non_synthetic_fields(
         self._test_class, fields
     )
     return self._test_class(
         self.context,
         **obj_test_base.remove_timestamps_from_fields(fields))
Ejemplo n.º 2
0
 def setUp(self):
     super(DefaultSecurityGroupDbObjTestCase, self).setUp()
     sg_db_obj = self.get_random_fields(securitygroup.SecurityGroup)
     sg_fields = securitygroup.SecurityGroup.modify_fields_from_db(
         sg_db_obj)
     self.sg_obj = securitygroup.SecurityGroup(
         self.context, **test_base.remove_timestamps_from_fields(sg_fields))
     self.sg_obj.create()
     for obj in itertools.chain(self.db_objs, self.obj_fields, self.objs):
         obj['security_group_id'] = self.sg_obj['id']