示例#1
0
    def test_flattened_list(self):
        pipeline = Pipeline(TestNode('a') | [[Node('b'), Node('c')]])

        with print_catcher() as catcher:
            print(pipeline)

        self.assertTrue('a | [b, c]' in catcher.txt)
示例#2
0
    def test_ror(self):
        a = Node('a')
        b = Node('b')
        c = Node('c')
        d = Node('d')

        p = Pipeline(a | ([b, c] | d))
        with print_catcher() as catcher:
            print(p)
        self.assertTrue('a | [b, c]' in catcher.txt)
        self.assertTrue('c | d' in catcher.txt)
        self.assertTrue('b | d' in catcher.txt)