rasterio/tests/test_descriptions.py
Sean Gillies d1aae894e9 Rename set_band_description to set_description
Since a dataset's description isn't modifiable, or even useful.
2016-08-20 15:47:02 +02:00

16 lines
598 B
Python

import rasterio
from rasterio.profiles import default_gtiff_profile
def test_set_band_descriptions(tmpdir):
"""Descriptions can be set when dataset is open"""
tmptiff = str(tmpdir.join('test.tif'))
with rasterio.open(
tmptiff, 'w', count=2, height=256, width=256,
**default_gtiff_profile) as dst:
assert dst.descriptions == (None, None)
dst.set_description(1, "this is a test band")
dst.set_description(2, "this is another test band")
assert dst.descriptions == (
"this is a test band", "this is another test band")