Skip to content

Commit

Permalink
TST: test geometry_type (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis authored Sep 12, 2023
1 parent 21cc3ef commit 8a9dfa1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion geodatasets/json/database.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"attribution": "Center for Spatial Data Science, University of Chicago",
"name": "geoda.home_sales",
"description": "2014-15 Home Sales in King County, WA",
"geometry_type": "Polygon",
"geometry_type": "Point",
"nrows": 21613,
"ncols": 22,
"details": "https://geodacenter.github.io/data-and-lab//KingCounty-HouseSales2015/",
Expand Down
8 changes: 8 additions & 0 deletions geodatasets/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ def test_data_exists(name):
gdf = gpd.read_file(geodatasets.get_path(name), engine="pyogrio")
assert isinstance(gdf, pd.DataFrame)
assert gdf.shape == (dataset.nrows, dataset.ncols)
if not (
".csv" in dataset.filename
or (
hasattr(dataset, "members")
and any(".csv" in member for member in dataset.members)
)
):
assert gdf.geom_type.str.endswith(dataset.geometry_type).all()

0 comments on commit 8a9dfa1

Please sign in to comment.