@@ -37,6 +37,19 @@ def testalg(instance, parameters, context, feedback, inputs):
37
37
"""
38
38
39
39
40
+ def define_new_no_outputs_but_sink_instead (newid = 1 ):
41
+ @alg (name = ARGNAME .format (newid ), label = alg .tr ("Test func" ), group = "unittest" ,
42
+ group_label = alg .tr ("Test label" ))
43
+ @alg .help (HELPSTRING .format (newid ))
44
+ @alg .input (type = alg .SOURCE , name = "INPUT" , label = "Input layer" )
45
+ @alg .input (type = alg .DISTANCE , name = "DISTANCE" , label = "Distance" , default = 30 )
46
+ @alg .input (type = alg .SINK , name = "SINK" , label = "Output layer" )
47
+ def testalg (instance , parameters , context , feedback , inputs ):
48
+ """
49
+ Given a distance will split a line layer into segments of the distance
50
+ """
51
+
52
+
40
53
def define_new_doc_string (newid = 1 ):
41
54
@alg (name = ARGNAME .format (newid ), label = alg .tr ("Test func" ), group = "unittest" ,
42
55
group_label = alg .tr ("Test label" ))
@@ -75,6 +88,15 @@ def test_can_have_no_inputs(self):
75
88
define_new_no_inputs ()
76
89
77
90
91
+ class AlgNoOutputsButSinkInstead (unittest .TestCase ):
92
+
93
+ def setUp (self ):
94
+ cleanup ()
95
+
96
+ def test_can_have_no_outputs_if_there_is_destination (self ):
97
+ define_new_no_outputs_but_sink_instead ()
98
+
99
+
78
100
class AlgInstanceTests (unittest .TestCase ):
79
101
"""
80
102
Tests to check the createInstance method will work as expected.
0 commit comments