File: test_read_drivers.py

package info (click to toggle)
fiona 1.10.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,660 kB
  • sloc: python: 12,616; makefile: 214; sh: 45
file content (20 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (5)
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'