File: test_open_overview_level.py

package info (click to toggle)
rasterio 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,732 kB
  • sloc: python: 23,119; sh: 947; makefile: 275; xml: 29
file content (18 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Tests for fix of #1504"""

import rasterio


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)