From 8a9dfa17016973c18a170e6f1fab18f5854a0451 Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Tue, 12 Sep 2023 10:28:30 +0200 Subject: [PATCH] TST: test geometry_type (#15) --- geodatasets/json/database.json | 2 +- geodatasets/tests/test_data.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/geodatasets/json/database.json b/geodatasets/json/database.json index 77a0d43..a812502 100644 --- a/geodatasets/json/database.json +++ b/geodatasets/json/database.json @@ -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/", diff --git a/geodatasets/tests/test_data.py b/geodatasets/tests/test_data.py index 0ac8940..973926a 100644 --- a/geodatasets/tests/test_data.py +++ b/geodatasets/tests/test_data.py @@ -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()