def test_upgrade_with_deleted_flavors(self): flavor = db_api.flavor_create(self.context, self.flavor_values) db_api.flavor_destroy(self.context, flavor['flavorid']) self.migration.upgrade(self.engine)
def test_upgrade_dirty_flavors(self): db_api.flavor_create(self.context, self.flavor_values) self.assertRaises(exception.ValidationError, self.migration.upgrade, self.engine)
def _create_main_flavor(self, **updates): values = dict(fake_api_flavor, flavorid='mainflavor') del values['projects'] del values['extra_specs'] values.update(updates) return db_api.flavor_create(self.context, values)