rasterio/tests/test_open.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

23 lines
510 B
Python

import pytest
import rasterio
def test_open_bad_path():
with pytest.raises(TypeError):
rasterio.open(3.14)
def test_open_bad_mode_1():
with pytest.raises(TypeError):
rasterio.open("tests/data/RGB.byte.tif", mode=3.14)
def test_open_bad_mode_2():
with pytest.raises(ValueError):
rasterio.open("tests/data/RGB.byte.tif", mode="foo")
def test_open_bad_driver():
with pytest.raises(TypeError):
rasterio.open("tests/data/RGB.byte.tif", mode="r", driver=3.14)