Skip to content

Commit

Permalink
Merge pull request #9922 from rouault/test_ogr_gmlas_get_gml_and_iso_…
Browse files Browse the repository at this point in the history
…schemas_robus

autotest: make test_ogr_gmlas_get_gml_and_iso_schemas() more robust to Inspire server being not available
  • Loading branch information
rouault committed May 14, 2024
2 parents e187124 + 414fb59 commit 1687a31
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions autotest/ogr/ogr_gmlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3434,17 +3434,19 @@ def test_ogr_gmlas_read_srsDimension_3_on_top_gml_Envelope():
@pytest.mark.require_curl()
def test_ogr_gmlas_get_gml_and_iso_schemas(tmp_path):

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

cache_path = str(tmp_path / "cache")

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

0 comments on commit 1687a31

Please sign in to comment.