rasterio/tests/test_open_overview_level.py
Sean Gillies 4aebf73c51
Test fix for #1701 (#1704)
* Test fix for #1701

* Test for fix of problem noted in #1504

* Add sharing tests

* Require GDAL 2 for sharing tests

* Require GDAL 2 for overview level test
2019-06-05 16:15:30 -06:00

22 lines
651 B
Python

"""Tests for fix of #1504"""
import rasterio
from .conftest import requires_gdal2
@requires_gdal2
def test_overview_levels(path_cogeo_tif):
"""With sharing turned off, problem noted in #1504 vanishes"""
olevel = 0
with rasterio.open(path_cogeo_tif, overview_level=olevel) as src:
assert src.shape == (512, 512)
olevel = 1
with rasterio.open(path_cogeo_tif, sharing=False, overview_level=olevel) as src:
assert src.shape == (256, 256)
olevel = 2
with rasterio.open(path_cogeo_tif, sharing=False, overview_level=olevel) as src:
assert src.shape == (128, 128)