Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few testing improvements #11

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 26 additions & 65 deletions autotest/ogr/ogr_miramon_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@

import gdaltest

# import ogrtest
import pytest

# from osgeo import gdal, ogr, osr
from osgeo import gdal, ogr

# import ogrtest
# import pytest

pytestmark = pytest.mark.require_driver("MiraMonVector")

###############################################################################
# basic point test
Expand Down Expand Up @@ -426,70 +427,30 @@ def test_ogr_miramon_3d_pol():
###############################################################################


def test_ogr_miramon_test_ogrsf():
@pytest.mark.parametrize(
"filename",
[
"Points/3dpoints/Some3dPoints.pnt",
"Points/SimplePoints/SimplePointsFile.pnt",
"Points/EmptyPoints/Empty_PNT.pnt",
"Arcs/SimpleArcs/SimpleArcFile.arc",
"Arcs/EmptyArcs/Empty_ARC.arc",
"Arcs/3dArcs/linies_3d_WGS84.arc",
"Polygons/SimplePolygons/SimplePolFile.pol",
"Polygons/EmptyPolygons/Empty_POL.pol",
"Polygons/3dPolygons/tin_3d.pol",
],
)
def test_ogr_miramon_test_ogrsf(filename):

import test_cli_utilities

if test_cli_utilities.get_test_ogrsf_path() is not None:
ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Points/3dpoints/Some3dPoints.pnt"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Points/SimplePoints/SimplePointsFile.pnt"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Points/EmptyPoints/Empty_PNT.pnt"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Arcs/SimpleArcs/SimpleArcFile.arc"
)
if test_cli_utilities.get_test_ogrsf_path() is None:
pytest.skip("test_ogrsf not available")

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Arcs/EmptyArcs/Empty_ARC.arc"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Arcs/3dArcs/linies_3d_WGS84.arc"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Polygons/SimplePolygons/SimplePolFile.pol"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Polygons/EmptyPolygons/Empty_POL.pol"
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1

ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path()
+ " data/miramon/Polygons/3dPolygons/tin_3d.pol"
)
ret = gdaltest.runexternal(
test_cli_utilities.get_test_ogrsf_path() + " data/miramon/" + filename
)

assert ret.find("INFO") != -1 and ret.find("ERROR") == -1
assert "INFO" in ret
assert "ERROR" not in ret
Loading