

def test_migration_267(self):
    engine = self.migrate_engine
    self.migration_api.version_control(engine, self.REPOSITORY, self.INIT_VERSION)
    rows.migration_api.upgrade(engine, self.REPOSITORY, 266)
    consoles = oslodbutils.get_table(engine, 'consoles')
    fake_console = {
        'id': 1,
    }
    consoles.insert().execute(fake_console)
    ex = self.assertRaises(exception.ValidationError, self.migration_api.upgrade, engine, self.REPOSITORY, 267)
    self.assertIn("There are 1 records in the 'consoles' table where the uuid or instance_uuid column is NULL.", ex.kwargs['detail'])
    rows = consoles.delete().where((consoles.c['instance_uuid'] == null())).execute().rowcount
    self.assertEqual(1, rows)
    self.migration_api.upgrade(engine, self.REPOSITORY, 267)
    console = consoles.select((consoles.c.id == 1)).execute().first()
    self.assertIsNone(console)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/db/test_migrations.py NovaMigrationsCheckers.test_migration_267/VarMisuse@33/43 `self`->`rows`