Fix travis (#476)
* Fix csv ogr test * Fix ogr wfs test from complex geojson
This commit is contained in:
committed by
GitHub
parent
a5aaef0f63
commit
1d4536f3f1
@@ -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())
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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': {
|
||||
|
||||
Reference in New Issue
Block a user