[Qgis-developer] Processing tests for gdal:extractprojection -> no output file

Nyall Dawson nyall.dawson at gmail.com
Thu Jan 12 15:36:20 PST 2017


On 13 January 2017 at 00:18, matteo <matteo.ghetta at gmail.com> wrote:
> Hi Matthias,
>
> thanks for the complete answer.
>
> However I added the qgis:createspatialindex algorithm that does not
> produce any output (but it is still "linked" to the input layer) and the
> test runs fine with the parameter

There's already a test for this - see

https://github.com/qgis/QGIS/commit/e7e9ba0efc66761193e98b384dda318609cac05c

Basically you need to flag that an algorithm modifies a given dataset
in place by adding the 'in_place: true' line to an input dataset.
Then, you also need to indicate that the result file should match the
modified in place dataset by adding 'in_place_result: true' to the
expected result.

This is all done manually - the 'create test' option in the processing
log doesn't have anyway to automatically handle this.

Doing this allows the processing test to know that it needs to make a
temporary copy of the input dataset, run the alg, and then compare
results against the modified input dataset. So basically it tests both
that the algorithm ran and also checks that the results are as
expected.

Nyall




>
> result: {}
>
> in this way I thought it is possible to check the output (without
> testing it) but testing the algorithm itself, i.e. the algorithm runs
> fine and creates the output.
>
>
> Thanks again for the availability
>
> Cheers
>
> Matteo
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list