Skip to content
Browse files

[processing] consider destination params as outputs when defining scr…


(cherry picked from commit 29b952d)
  • Loading branch information
volaya authored and nyalldawson committed Feb 25, 2019
1 parent d966d9c commit e1f341f257d273304d62ed4e1456468bd84ef0a0
Showing with 24 additions and 1 deletion.
  1. +2 −1 python/processing/
  2. +22 −0 tests/src/python/
@@ -211,7 +211,8 @@ def has_outputs(self):
True if this alg wrapper has outputs defined.
return bool(self._outputs)
dests = [p for p in self._inputs.values() if p.isDestination()]
return bool(self._outputs) or bool(dests)

def has_inputs(self):
@@ -37,6 +37,19 @@ def testalg(instance, parameters, context, feedback, inputs):

def define_new_no_outputs_but_sink_instead(newid=1):
@alg(name=ARGNAME.format(newid),"Test func"), group="unittest","Test label"))
@alg.input(type=alg.SOURCE, name="INPUT", label="Input layer")
@alg.input(type=alg.DISTANCE, name="DISTANCE", label="Distance", default=30)
@alg.input(type=alg.SINK, name="SINK", label="Output layer")
def testalg(instance, parameters, context, feedback, inputs):
Given a distance will split a line layer into segments of the distance

def define_new_doc_string(newid=1):
@alg(name=ARGNAME.format(newid),"Test func"), group="unittest","Test label"))
@@ -75,6 +88,15 @@ def test_can_have_no_inputs(self):

class AlgNoOutputsButSinkInstead(unittest.TestCase):

def setUp(self):

def test_can_have_no_outputs_if_there_is_destination(self):

class AlgInstanceTests(unittest.TestCase):
Tests to check the createInstance method will work as expected.

0 comments on commit e1f341f

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