1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
import pytest
import fiona
from fiona.errors import FionaValueError
def test_read_fail(path_coutwildrnp_shp):
with pytest.raises(FionaValueError):
fiona.open(path_coutwildrnp_shp, driver='GeoJSON')
with pytest.raises(FionaValueError):
fiona.open(path_coutwildrnp_shp, enabled_drivers=['GeoJSON'])
def test_read(path_coutwildrnp_shp):
with fiona.open(path_coutwildrnp_shp, driver='ESRI Shapefile') as src:
assert src.driver == 'ESRI Shapefile'
with fiona.open(
path_coutwildrnp_shp,
enabled_drivers=['GeoJSON', 'ESRI Shapefile']) as src:
assert src.driver == 'ESRI Shapefile'
|