rasterio/tests/test_band.py
Sean Gillies 12f8fc7e3f New, lazier AWS sessions
New Env class and tests.
More logging, tests, safer environment
Remove usage (deprecated) of rasterio.drivers()
Also pep8 cleanups throughout the tests and a fix for unchecked
dtypes when opening a dataset in 'w' mode.
Now we can simply import warnings in __init__.py. In the
deprecations tests, we needed to see a single warning only one
time to avoid multiple drivers() warnings.
Add a global env.
Add rasterio.env.setenv()
2016-04-28 15:26:55 -06:00

16 lines
332 B
Python

import logging
import rasterio
import rasterio.env
logging.basicConfig(level=logging.DEBUG)
def test_band():
with rasterio.open('tests/data/RGB.byte.tif') as src:
b = rasterio.band(src, 1)
assert b.ds == src
assert b.bidx == 1
assert b.dtype in src.dtypes
assert b.shape == src.shape