def _main_group(self, policies=None, members=None, **values): vals = { 'user_id': self.context.user_id, 'project_id': self.context.project_id, 'name': 'foogroup', } vals.update(values) policies = policies or ['foo1', 'foo2'] members = members or ['memberfoo'] return db_api.instance_group_create(self.context, vals, policies=policies, members=members)
def test_upgrade_with_deleted_instance_groups(self): group = db_api.instance_group_create(self.context, self.ig_values) db_api.instance_group_delete(self.context, group['uuid']) self.migration.upgrade(self.engine)
def test_upgrade_dirty_instance_groups(self): db_api.instance_group_create(self.context, self.ig_values) self.assertRaises(exception.ValidationError, self.migration.upgrade, self.engine)