Skip to content

Commit

Permalink
Allow skipping crs check in processing test results
Browse files Browse the repository at this point in the history
The GML format often requires extra 'hand holding' in order to
get QGIS to detect it's CRS (e.g. GML files created directly
in GDAL will not have an autodetected CRS when pulled into
QGIS). This needs fixing, but as a workaround to allow
processing algorithm porting to continue we can now skip
the crs check for these layers.
  • Loading branch information
nyalldawson committed Aug 13, 2017
1 parent 0a365b2 commit b87b2fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -102,6 +102,8 @@ tests:
OUTPUT:
name: expected/gdal/points_along_lines.gml
type: vector
compare:
ignore_crs_check: true

# - algorithm: gdal:offsetlinesforlines
# name: Offset lines for lines (right-handed)
Expand Down
9 changes: 5 additions & 4 deletions python/testing/__init__.py
Expand Up @@ -86,10 +86,11 @@ def checkLayersEqual(self, layer_expected, layer_result, use_asserts=False, **kw
compare = {}

# Compare CRS
if use_asserts:
_TestCase.assertEqual(self, layer_expected.dataProvider().crs().authid(), layer_result.dataProvider().crs().authid())
elif not layer_expected.dataProvider().crs().authid() == layer_result.dataProvider().crs().authid():
return False
if 'ignore_crs_check' not in compare or not compare['ignore_crs_check']:
if use_asserts:
_TestCase.assertEqual(self, layer_expected.dataProvider().crs().authid(), layer_result.dataProvider().crs().authid())
elif not layer_expected.dataProvider().crs().authid() == layer_result.dataProvider().crs().authid():
return False

# Compare features
if use_asserts:
Expand Down

0 comments on commit b87b2fe

Please sign in to comment.