-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processing] check for parent alg dependencies in hasDependencies() #3742
Conversation
What do you think about adding a unit test for this? We should start building up the test coverage of processing non-algorithm code. #3739 has the start of a unit test file for modeller. |
@nyalldawson I'm not against the idea :) processing would definitively benefit from increased unit tests. Feel free to merge this PR now, I'll create a PR for a test unit when you merge your PR. |
@nyalldawson , one set of unit tests could be built around loading a test.model file which includes a bunch of features to look over (parent alg being one). |
Excellent. |
32b211e
to
45b2cb5
Compare
@nyalldawson , test covering parent alg dependency added. |
@@ -66,6 +66,15 @@ def testModelerParametersDialogAvailableValuesOfType(self): | |||
self.assertEqual(set(p.name for p in dlg.getAvailableValuesOfType([ParameterString, ParameterNumber, ParameterFile])), | |||
set(['string', 'string2', 'number', 'file'])) | |||
|
|||
a = Algorithm("qgis:clip") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in it's own function, not at the end of testModelerParametersDialogAvailableValuesOfType ;)
45b2cb5
to
be2223f
Compare
@nyalldawson , oups; I've now moved the test into its own function, and added a few lines to test algorithm output dependency too. |
@volaya , this PR fixes hasDependencies() to check user-declared parent dependencies too. Failing to do so leads to a crash and the user is served with a mysterious stack trace.