def test_get_pois_from_an_unexisting_location(): location_name = "dsfsdfsdf" with pytest.raises(ErrorOsmGtCore) as excinfo: _ = OsmGt.pois_from_location(location_name) assert "Location not found!" == str(excinfo.value)
def test_run_from_location_name_with_additional_nodes( default_output_pois_columns, default_output_network_columns ): location_name = "roanne" pois_initialized = OsmGt.pois_from_location(location_name) pois_study_area = pois_initialized.study_area assert pois_study_area.geom_type == "Polygon" pois_gdf = pois_initialized.get_gdf() network_initialized = OsmGt.roads_from_location( location_name, "pedestrian", pois_gdf ) study_area = network_initialized.study_area assert study_area.geom_type == "Polygon" graph_computed = network_initialized.get_graph() network_gdf = network_initialized.get_gdf() shared_asserts( pois_gdf, network_gdf, default_output_pois_columns, default_output_network_columns, graph_computed, ) network_topology_gdfs = network_initialized.topology_checker() assert { "lines_unchanged", "lines_added", "lines_split", "nodes_added", "intersections_added", } == set(network_topology_gdfs.keys()) for topology_gdf in network_topology_gdfs.values(): assert topology_gdf.shape[0] > 0 assert topology_gdf.shape[1] == 5