diff --git a/tests/test_api.py b/tests/test_api.py index 1dc3c2c..39b0e38 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -167,10 +167,9 @@ def test_netcdf_extract_bbox_time(): [-90.0, 0.0, 90.0, 357.5], ['2002-07-01', '2002-07-31']] -def test_gpkg_extract_bboxs(): - result = geoextent.fromFile("tests/testdata/geopackage/nc.gpkg", bbox=True) - assert result['bbox'] == pytest.approx([-84.323835, 33.882102, -75.456585, 36.589757], abs=tolerance) - assert result["crs"] == "4326" +def test_gpkg_extract_tbox(): + result = geoextent.fromFile("tests/testdata/geopackage/wandelroute_maastricht.gpkg", tbox=True) + assert result['tbox'] == ['2021-01-05', '2021-01-05'] @pytest.mark.skipif("TRAVIS" in os.environ and os.environ["TRAVIS"] == "true", diff --git a/tests/test_cli.py b/tests/test_cli.py index 3156285..2cc7bea 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -199,6 +199,14 @@ def test_gpkg_bbox(script_runner): assert "4326" in result +def test_gpkg_tbox(script_runner): + ret = script_runner.run('geoextent', '-t', 'tests/testdata/geopackage/wandelroute_maastricht.gpkg') + result = ret.stdout + assert ret.success, "process should return success" + assert ret.stderr == '', "stderr should be empty" + assert "['2021-01-05', '2021-01-05']" in result + + def test_csv_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/csv/cities_NL.csv') assert ret.success, "process should return success" diff --git a/tests/testdata/data-sources.md b/tests/testdata/data-sources.md index f14e005..0d4f88b 100644 --- a/tests/testdata/data-sources.md +++ b/tests/testdata/data-sources.md @@ -19,7 +19,8 @@ | [Carto BCN / martgnz] | Barcelona districts | geojson | CC-BY 4.0 | | [Google] | abstractviews_timeprimitive_example | kml | CC-BY 4.0 | | [Tkrajina] | gpx1.1_with_all_fields.gpx | gpx | Apache License 2.0 | - +| [geoextent] | ifgi_to_denkpause.sph | shp | PDDL | +| [geoextent] | wandelroute_maastricht.gpkg | gpkg | PDDL | [sf]: https://github.com/r-spatial/sf [geoextent]: https://github.com/o2r-project/geoextent diff --git a/tests/testdata/geopackage/wandelroute_maastricht.gpkg b/tests/testdata/geopackage/wandelroute_maastricht.gpkg new file mode 100644 index 0000000..df15449 Binary files /dev/null and b/tests/testdata/geopackage/wandelroute_maastricht.gpkg differ