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 10, 2016
1 parent c91790f commit 183c53b3978c9b61286f4e0bd82203d9f7265d88
Showing with 4 additions and 1 deletion.
  1. +4 −1 python/testing/__init__.py
@@ -73,7 +73,10 @@ def assertLayersEqual(self, layer_expected, layer_result, **kwargs):
except KeyError:
precision = 14

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 183c53b

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