Fix travis (#476)

* Fix csv ogr test

* Fix ogr wfs test from complex geojson
This commit is contained in:
Francesco Bartoli
2020-06-30 20:41:47 +02:00
committed by GitHub
parent a5aaef0f63
commit 1d4536f3f1
3 changed files with 9 additions and 4 deletions
+7 -2
View File
@@ -427,6 +427,10 @@ class OGRProvider(BaseProvider):
def _get_next_feature(self, layer, feature_id):
try:
if layer.GetFeatureCount() == 0:
LOGGER.error("item {} is not found".format(feature_id))
raise ProviderItemNotFoundError(
"item {} not found".format(feature_id))
# Ignore gdal error
next_feature = _ignore_gdal_error(layer, 'GetNextFeature')
if next_feature:
@@ -436,8 +440,9 @@ class OGRProvider(BaseProvider):
"Object properties are all null"
)
else:
raise ProviderItemNotFoundError(
"item {} not found".format(feature_id))
raise RuntimeError(
"GDAL has returned a null feature for item {}".format(
feature_id))
return next_feature
except RuntimeError as gdalerr:
LOGGER.error(self.gdal.GetLastErrorMsg())
+1 -1
View File
@@ -85,7 +85,7 @@ def test_get_vsicurl(config_vsicurl_csv):
p = OGRProvider(config_vsicurl_csv)
result = p.get('32')
assert result['id'] == 32
assert '11' in result['properties']['codice_regione']
assert '14' in result['properties']['codice_regione']
def test_get_not_existing_feature_raise_exception(
+1 -1
View File
@@ -137,7 +137,7 @@ def config_geonode_gs_WFS():
'data': {
'source_type': 'WFS',
'source':
'WFS:https://geonode.wfp.org/geoserver/wfs?',
'WFS:https://geonode.wfp.org/geoserver/wfs',
'source_srs': 'EPSG:4326',
'target_srs': 'EPSG:4326',
'source_capabilities': {