Ejemplo n.º 1
0
    def test__driver_name__with_geojson__returns_geojson(self):
        FILE_EXTENSION = 'example.geojson'
        EXPECTED_DRIVER_NAME = 'GeoJSON'

        driver = get_ogr_driver(FILE_EXTENSION)

        self.assertEqual(driver.GetName(), EXPECTED_DRIVER_NAME)
Ejemplo n.º 2
0
    def test__driver_name__with_shp__returns_esri_shapefile(self):
        FILE_EXTENSION = 'example.shp'
        EXPECTED_DRIVER_NAME = 'ESRI Shapefile'

        driver = get_ogr_driver(FILE_EXTENSION)

        self.assertEqual(driver.GetName(), EXPECTED_DRIVER_NAME)
Ejemplo n.º 3
0
    def test__with_unknown_extension__returns_valueerror(self):
        FILE_EXTENSION = 'example.unknown'

        with self.assertRaises(ValueError):
            get_ogr_driver(FILE_EXTENSION)