python_arango_ogm.db.tests.test_pao_migration_builder
1import pathlib 2import shutil 3 4from python_arango_ogm.db.pao_migration_builder import PAOMigrationBuilder 5 6mig_path = pathlib.Path(__file__).parent.parent.parent.parent.resolve() 7print("MIGRATION PATH:", mig_path) 8 9def test_simple_migration_builder(): 10 migrator_builder = PAOMigrationBuilder(mig_path) 11 12 try: 13 migrator_builder.create_model_migrations() 14 assert len(migrator_builder.existing_migrations)==5 15 16 # Check that no new migrations were created: 17 migrator_builder.create_model_migrations() 18 assert len(migrator_builder.existing_migrations)==5 19 finally: 20 print("Deleting migrations from ", migrator_builder.migration_pathname) 21 # shutil.rmtree(migrator_builder.migration_pathname) 22 23 24if __name__ == '__main__': 25 test_simple_migration_builder()
mig_path =
PosixPath('/Users/windfox/src/python-arango-ogm')
def
test_simple_migration_builder():
10def test_simple_migration_builder(): 11 migrator_builder = PAOMigrationBuilder(mig_path) 12 13 try: 14 migrator_builder.create_model_migrations() 15 assert len(migrator_builder.existing_migrations)==5 16 17 # Check that no new migrations were created: 18 migrator_builder.create_model_migrations() 19 assert len(migrator_builder.existing_migrations)==5 20 finally: 21 print("Deleting migrations from ", migrator_builder.migration_pathname) 22 # shutil.rmtree(migrator_builder.migration_pathname)