Skip to content

Commit 1687a31

Browse files
authored
Merge pull request OSGeo#9922 from rouault/test_ogr_gmlas_get_gml_and_iso_schemas_robus
autotest: make test_ogr_gmlas_get_gml_and_iso_schemas() more robust to Inspire server being not available
2 parents e187124 + 414fb59 commit 1687a31

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

autotest/ogr/ogr_gmlas.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -3434,17 +3434,19 @@ def test_ogr_gmlas_read_srsDimension_3_on_top_gml_Envelope():
34343434
@pytest.mark.require_curl()
34353435
def test_ogr_gmlas_get_gml_and_iso_schemas(tmp_path):
34363436

3437-
url = "https://schemas.opengis.net/iso/19139/iso19139-20070417.zip"
3438-
conn = gdaltest.gdalurlopen(url, timeout=4)
3439-
if conn is None:
3440-
pytest.skip(f"cannot open {url}")
3437+
iso19139_url = "https://schemas.opengis.net/iso/19139/iso19139-20070417.zip"
3438+
inspire_url = "https://inspire.ec.europa.eu/schemas/base/3.3/BaseTypes.xsd"
3439+
for url in [iso19139_url, inspire_url]:
3440+
conn = gdaltest.gdalurlopen(url, timeout=4)
3441+
if conn is None:
3442+
pytest.skip(f"cannot open {url}")
34413443

34423444
cache_path = str(tmp_path / "cache")
34433445

34443446
ds = gdal.OpenEx(
34453447
"GMLAS:",
34463448
open_options=[
3447-
"XSD=https://inspire.ec.europa.eu/schemas/base/3.3/BaseTypes.xsd",
3449+
"XSD=" + inspire_url,
34483450
f"CONFIG_FILE=<Configuration><AllowRemoteSchemaDownload>true</AllowRemoteSchemaDownload><SchemaCache><Directory>{cache_path}</Directory></SchemaCache><LayerBuildingRules><IdentifierMaxLength>10</IdentifierMaxLength><PostgreSQLIdentifierLaundering>false</PostgreSQLIdentifierLaundering></LayerBuildingRules></Configuration>",
34493451
],
34503452
)

0 commit comments

Comments
 (0)