Exemplo n.º 1
0
def test_deploy_and_revert_deploy():
    """Revert deploy succeeds"""
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    # import again to have a new import schema
    t.imposm3_import(t.db_conf, './build/complete_db.pbf', mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)

    t.imposm3_deploy(t.db_conf, mapping_file)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    t.imposm3_revert_deploy(t.db_conf, mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)
Exemplo n.º 2
0
def test_deploy_and_revert_deploy():
    """Revert deploy succeeds"""
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    # import again to have a new import schema
    t.imposm3_import(t.db_conf, './build/complete_db.pbf', mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)

    t.imposm3_deploy(t.db_conf, mapping_file)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    t.imposm3_revert_deploy(t.db_conf, mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)
Exemplo n.º 3
0
def test_remove_backup():
    """Remove backup succeeds"""
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    t.imposm3_deploy(t.db_conf, mapping_file)

    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    t.imposm3_remove_backups(t.db_conf, mapping_file)

    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)
Exemplo n.º 4
0
def test_remove_backup():
    """Remove backup succeeds"""
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    t.imposm3_deploy(t.db_conf, mapping_file)

    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)

    t.imposm3_remove_backups(t.db_conf, mapping_file)

    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_BACKUP)
Exemplo n.º 5
0
def test_deploy():
    """Deploy succeeds"""
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    t.imposm3_deploy(t.db_conf, mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
Exemplo n.º 6
0
def test_import():
    """Import succeeds"""
    t.drop_schemas()
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    t.imposm3_import(t.db_conf, './build/complete_db.pbf', mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
Exemplo n.º 7
0
def test_deploy():
    """Deploy succeeds"""
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    t.imposm3_deploy(t.db_conf, mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_PRODUCTION)
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
Exemplo n.º 8
0
def test_import():
    """Import succeeds"""
    t.drop_schemas()
    assert not t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)
    t.imposm3_import(t.db_conf, './build/complete_db.pbf', mapping_file)
    assert t.table_exists('osm_roads', schema=t.TEST_SCHEMA_IMPORT)