Skip to content


In place test POC completed
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Sep 14, 2018
1 parent f35e376 commit ac55ce0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions tests/src/python/
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,31 @@ def test_algs(self):
parameters = {}
parameters['INPUT'] = QgsProcessingFeatureSourceDefinition(, True)
parameters['OUTPUT'] = 'memory:'
parameters['DELTA_X'] = 1.1
parameters['DELTA_Y'] = 1.1

context = QgsProcessingContext()
feedback = QgsProcessingFeedback()
self.assertTrue(alg.prepare(parameters, context, feedback))


field_idxs = range(len(self.vl.fields()))

new_features = {}
for f in self.vl.getFeatures():
new_f = alg.processFeature(f, context, feedback)[0]
new_features[] = new_f
# This alg does change the geometry!
self.vl.changeGeometry(, new_f.geometry())
# This alg does not change attrs but some other might do
self.vl.changeAttributeValues(, dict(zip(field_idxs, new_f.attributes())), dict(zip(field_idxs, f.attributes())))

from IPython import embed; embed()


for f in self.vl.getFeatures():
self.assertEqual(new_features[].geometry().asWkt(), f.geometry().asWkt())

if __name__ == '__main__':
Expand Down

0 comments on commit ac55ce0

Please sign in to comment.