Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
barneydobson committed Oct 24, 2024
1 parent 44c7373 commit a64197e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ def test_building_downloader_download():
# Make sure has some rows
assert gdf.shape[0] > 0

@pytest.mark.downloads
def test_building_bbox_downloader_download():
"""Check buildings are downloaded."""
# Coordinates for small country (VAT)
bbox = (-0.17929, 51.49638, -0.17383, 51.49846)
with tempfile.TemporaryDirectory() as temp_dir:
temp_fid = Path(temp_dir) / "temp.parquet"
# Download
response = downloaders.download_buildings_bbox(temp_fid, bbox)

# Check file exists
assert temp_fid.exists(), "Buildings data file not found after download."

# Load data
gdf = gpd.read_parquet(temp_fid)

# Make sure has some rows
assert gdf.shape[0] > 0

@pytest.mark.downloads
def test_street_downloader_download():
Expand Down

0 comments on commit a64197e

Please sign in to comment.