Exemplo n.º 1
0
    def test_register_1(self):

        #register
        assert 5 == P.Pipe(
            3,
            P.add(2)
        )

        #Register2
        assert 8 == P.Pipe(
            3,
            P.pow(2)
        )

        #RegisterMethod
        assert "identity" == P.get_function_name()
Exemplo n.º 2
0
    def test_reference(self):
        add_ref = P.Ref('add_ref')

        assert 8 == 3 >> P.Make(P.add(2).On(add_ref).add(3))
        assert 5 == add_ref()