|
34 | 34 |
|
35 | 35 | import gdaltest
|
36 | 36 |
|
| 37 | +# import ogrtest |
| 38 | +import pytest |
| 39 | + |
37 | 40 | # from osgeo import gdal, ogr, osr
|
38 | 41 | from osgeo import gdal, ogr
|
39 | 42 |
|
40 |
| -# import ogrtest |
41 |
| -# import pytest |
42 |
| - |
| 43 | +pytestmark = pytest.mark.require_driver("MiraMonVector") |
43 | 44 |
|
44 | 45 | ###############################################################################
|
45 | 46 | # basic point test
|
@@ -426,70 +427,30 @@ def test_ogr_miramon_3d_pol():
|
426 | 427 | ###############################################################################
|
427 | 428 |
|
428 | 429 |
|
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): |
430 | 445 |
|
431 | 446 | import test_cli_utilities
|
432 | 447 |
|
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") |
459 | 450 |
|
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 | + ) |
494 | 454 |
|
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