Skip to content
Permalink
Browse files

Add another test

  • Loading branch information
nyalldawson committed Jun 21, 2017
1 parent 1d69939 commit 0db4cf37feda928aa3174740c278d7670ef96ec0
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/src/core/testqgsprocessing.cpp
@@ -3920,6 +3920,19 @@ void TestQgsProcessing::modelExecution()
QCOMPARE( params.value( "INPUT" ).toString(), QStringLiteral( "dest.shp" ) );
QCOMPARE( params.value( "OUTPUT_LAYER" ).toString(), QStringLiteral( "memory:" ) );
QCOMPARE( params.count(), 2 );

// a child with an optional output
QgsProcessingModelAlgorithm::ChildAlgorithm alg2c3;
alg2c3.setChildId( "cx3" );
alg2c3.setAlgorithmId( "native:extractbyexpression" );
alg2c3.addParameterSource( "INPUT", QgsProcessingModelAlgorithm::ChildParameterSource::fromChildOutput( "cx1", "OUTPUT_LAYER" ) );
alg2c3.addParameterSource( "EXPRESSION", QgsProcessingModelAlgorithm::ChildParameterSource::fromStaticValue( "true" ) );
model2.addChildAlgorithm( alg2c3 );
params = model2.parametersForChildAlgorithm( model2.childAlgorithm( "cx3" ), modelInputs, childResults );
QCOMPARE( params.value( "INPUT" ).toString(), QStringLiteral( "dest.shp" ) );
QCOMPARE( params.value( "EXPRESSION" ).toString(), QStringLiteral( "true" ) );
QCOMPARE( params.value( "OUTPUT" ).toString(), QStringLiteral( "memory:" ) );
QCOMPARE( params.count(), 3 ); // don't want FAIL_OUTPUT set!
}

void TestQgsProcessing::tempUtils()

0 comments on commit 0db4cf3

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