Skip to content


[processing] consider destination params as outputs when defining scr…
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya authored and nyalldawson committed Feb 25, 2019
1 parent 519a30f commit 29b952d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/processing/
Expand Up @@ -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):
Expand Down
22 changes: 22 additions & 0 deletions tests/src/python/
Expand Up @@ -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"))
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 29b952d

Please sign in to comment.