From b69cd8b265210b17631fcd661c5b5d55eba135f0 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Tue, 10 Sep 2024 15:05:59 +0200 Subject: [PATCH] skip some tests --- tests/test_io_stac.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/test_io_stac.py b/tests/test_io_stac.py index e8950e62..5fc646de 100644 --- a/tests/test_io_stac.py +++ b/tests/test_io_stac.py @@ -2,6 +2,7 @@ import json import os +import sys from typing import Dict, Set, Tuple, Type from unittest.mock import patch @@ -68,18 +69,6 @@ def test_fetch_stac(httpx, s3_get): assert stac.maxzoom == 8 assert stac.bounds - with STACReader(STAC_PATH_PROJ) as stac: - assert stac.minzoom == 6 - assert stac.maxzoom == 7 - assert stac.bounds - assert stac.crs == CRS.from_epsg(32617) - - with STACReader(STAC_PATH_PROJ, minzoom=4, maxzoom=8) as stac: - assert stac.minzoom == 4 - assert stac.maxzoom == 8 - assert stac.bounds - assert stac.crs == CRS.from_epsg(32617) - # Load from dict with STACReader(None, item=item) as stac: assert stac.minzoom == 0 @@ -155,6 +144,22 @@ def raise_for_status(self): assert s3_get.call_args[0] == ("somewhereovertherainbow.io", "mystac.json") +@pytest.mark.skipif(sys.version_info < (3, 9), reason="requires python3.9 or higher") +def test_projection_extension(): + """Test STAC with the projection extension.""" + with STACReader(STAC_PATH_PROJ) as stac: + assert stac.minzoom == 6 + assert stac.maxzoom == 7 + assert stac.bounds + assert stac.crs == CRS.from_epsg(32617) + + with STACReader(STAC_PATH_PROJ, minzoom=4, maxzoom=8) as stac: + assert stac.minzoom == 4 + assert stac.maxzoom == 8 + assert stac.bounds + assert stac.crs == CRS.from_epsg(32617) + + @patch("rio_tiler.io.rasterio.rasterio") def test_tile_valid(rio): """Should raise or return tiles."""