Exemplo n.º 1
0
def test_curry_call():
    @curry
    def add(x, y):
        return x + y
    assert raises(TypeError, lambda: add.call(1))
    assert add(1)(2) == add.call(1, 2)
    assert add(1)(2) == add(1).call(2)
Exemplo n.º 2
0
def test_curry_call():
    @curry
    def add(x, y):
        return x + y
    assert raises(TypeError, lambda: add.call(1))
    assert add(1)(2) == add.call(1, 2)
    assert add(1)(2) == add(1).call(2)
Exemplo n.º 3
0
def test_call():
    # f.call is an alias for f.invoke
    res = add.call(1, 2)
    assert res == 3