예제 #1
0
def test_partial():
    def f(a, b):
        return a + b

    def g(a, b):
        return b

    p = partialmethod(f, b=0)
    q = partialmethod(g, b=None)

    # Can't see how to use utils.py lines 59-61.
    assert p(1)
    assert getattr(q, 'keywords', None)
    assert q(1) is None
예제 #2
0
def test_partial():
    def f(a, b):
        return a + b

    def g(a, b):
        return b

    p = partialmethod(f, b=0)
    q = partialmethod(g, b=None)

    # Can't see how to use utils.py lines 59-61.
    assert p(1)
    assert getattr(q, "keywords", None)
    assert q(1) is None
예제 #3
0
def test_partial():
    """Pretty sure this test doesn't test what I need. See coverage report.
    """
    def f(a, b):
        return a + b

    def g(a, b):
        return b

    p = partialmethod(f, b=0)
    q = partialmethod(g, b=None)

    # Can't see how to use utils.py lines 59-61.
    assert p(1)
    assert getattr(q, 'keywords', None)
    assert q(1) is None