Skip to content

Commit ca936a9

Browse files
authored
Merge pull request #11 from rouault/miramon_improvements
A few testing improvements
2 parents e9f257f + c297abd commit ca936a9

File tree

1 file changed

+26
-65
lines changed

1 file changed

+26
-65
lines changed

autotest/ogr/ogr_miramon_vector.py

+26-65
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@
3434

3535
import gdaltest
3636

37+
# import ogrtest
38+
import pytest
39+
3740
# from osgeo import gdal, ogr, osr
3841
from osgeo import gdal, ogr
3942

40-
# import ogrtest
41-
# import pytest
42-
43+
pytestmark = pytest.mark.require_driver("MiraMonVector")
4344

4445
###############################################################################
4546
# basic point test
@@ -426,70 +427,30 @@ def test_ogr_miramon_3d_pol():
426427
###############################################################################
427428

428429

429-
def test_ogr_miramon_test_ogrsf():
430+
@pytest.mark.parametrize(
431+
"filename",
432+
[
433+
"Points/3dpoints/Some3dPoints.pnt",
434+
"Points/SimplePoints/SimplePointsFile.pnt",
435+
"Points/EmptyPoints/Empty_PNT.pnt",
436+
"Arcs/SimpleArcs/SimpleArcFile.arc",
437+
"Arcs/EmptyArcs/Empty_ARC.arc",
438+
"Arcs/3dArcs/linies_3d_WGS84.arc",
439+
"Polygons/SimplePolygons/SimplePolFile.pol",
440+
"Polygons/EmptyPolygons/Empty_POL.pol",
441+
"Polygons/3dPolygons/tin_3d.pol",
442+
],
443+
)
444+
def test_ogr_miramon_test_ogrsf(filename):
430445

431446
import test_cli_utilities
432447

433-
if test_cli_utilities.get_test_ogrsf_path() is not None:
434-
ret = gdaltest.runexternal(
435-
test_cli_utilities.get_test_ogrsf_path()
436-
+ " data/miramon/Points/3dpoints/Some3dPoints.pnt"
437-
)
438-
439-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
440-
441-
ret = gdaltest.runexternal(
442-
test_cli_utilities.get_test_ogrsf_path()
443-
+ " data/miramon/Points/SimplePoints/SimplePointsFile.pnt"
444-
)
445-
446-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
447-
448-
ret = gdaltest.runexternal(
449-
test_cli_utilities.get_test_ogrsf_path()
450-
+ " data/miramon/Points/EmptyPoints/Empty_PNT.pnt"
451-
)
452-
453-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
454-
455-
ret = gdaltest.runexternal(
456-
test_cli_utilities.get_test_ogrsf_path()
457-
+ " data/miramon/Arcs/SimpleArcs/SimpleArcFile.arc"
458-
)
448+
if test_cli_utilities.get_test_ogrsf_path() is None:
449+
pytest.skip("test_ogrsf not available")
459450

460-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
461-
462-
ret = gdaltest.runexternal(
463-
test_cli_utilities.get_test_ogrsf_path()
464-
+ " data/miramon/Arcs/EmptyArcs/Empty_ARC.arc"
465-
)
466-
467-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
468-
469-
ret = gdaltest.runexternal(
470-
test_cli_utilities.get_test_ogrsf_path()
471-
+ " data/miramon/Arcs/3dArcs/linies_3d_WGS84.arc"
472-
)
473-
474-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
475-
476-
ret = gdaltest.runexternal(
477-
test_cli_utilities.get_test_ogrsf_path()
478-
+ " data/miramon/Polygons/SimplePolygons/SimplePolFile.pol"
479-
)
480-
481-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
482-
483-
ret = gdaltest.runexternal(
484-
test_cli_utilities.get_test_ogrsf_path()
485-
+ " data/miramon/Polygons/EmptyPolygons/Empty_POL.pol"
486-
)
487-
488-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
489-
490-
ret = gdaltest.runexternal(
491-
test_cli_utilities.get_test_ogrsf_path()
492-
+ " data/miramon/Polygons/3dPolygons/tin_3d.pol"
493-
)
451+
ret = gdaltest.runexternal(
452+
test_cli_utilities.get_test_ogrsf_path() + " data/miramon/" + filename
453+
)
494454

495-
assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
455+
assert "INFO" in ret
456+
assert "ERROR" not in ret

0 commit comments

Comments
 (0)