source: orange/Orange/OrangeCanvas/scheme/tests/test_nodes.py @ 11101:e5aa7c1c5b23

Revision 11101:e5aa7c1c5b23, 1.1 KB checked in by Ales Erjavec <ales.erjavec@…>, 19 months ago (diff)

Added scheme package, containing the scheme graph workflow data structure/model.

Line 
1"""
2"""
3
4from ...gui import test
5from ...registry.tests import small_testing_registry
6from ...registry import InputSignal, OutputSignal
7
8from .. import SchemeNode
9
10
11class TestScheme(test.QAppTestCase):
12    def test_node(self):
13        """Test SchemeNode.
14        """
15        reg = small_testing_registry()
16        file_desc = reg.widget("Orange.OrangeWidgets.Data.OWFile.OWFile")
17
18        node = SchemeNode(file_desc)
19
20        inputs = node.input_channels()
21        self.assertSequenceEqual(inputs, file_desc.inputs)
22        for ch in inputs:
23            channel = node.input_channel(ch.name)
24            self.assertIsInstance(channel, InputSignal)
25            self.assertTrue(channel in inputs)
26        self.assertRaises(ValueError, node.input_channel, "%%&&&$$()[()[")
27
28        outputs = node.output_channels()
29        self.assertSequenceEqual(outputs, file_desc.outputs)
30        for ch in outputs:
31            channel = node.output_channel(ch.name)
32            self.assertIsInstance(channel, OutputSignal)
33            self.assertTrue(channel in outputs)
34        self.assertRaises(ValueError, node.output_channel, "%%&&&$$()[()[")
Note: See TracBrowser for help on using the repository browser.