Exemple #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
Exemple #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
Exemple #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