Skip to content
Permalink
Browse files

Make test layer comparison handle different order of features

(cherry-picked from f449bf2)
  • Loading branch information
nyalldawson committed Aug 9, 2016
1 parent 069ed71 commit 5ac4d0e5db35b6a48b0eec4c651df1ef35cf7a05
Showing with 4 additions and 1 deletion.
  1. +4 −1 python/testing/__init__.py
@@ -72,7 +72,10 @@ def assertLayersEqual(self, layer_expected, layer_result, **kwargs):
except KeyError:
precision = 17

for feats in zip(layer_expected.getFeatures(request), layer_result.getFeatures(request)):
expected_features = sorted(layer_expected.getFeatures(request), key=lambda f: f.id())
result_features = sorted(layer_expected.getFeatures(request), key=lambda f: f.id())

for feats in zip(expected_features, result_features):
if feats[0].geometry() is not None:
geom0 = feats[0].geometry().geometry().asWkt(precision)
else:

0 comments on commit 5ac4d0e

Please sign in to comment.
You can’t perform that action at this time.