Ejemplo n.º 1
0
def test_arginfo_cache():
    def foo(a):
        pass

    assert not arginfo.is_cached(foo)
    arginfo(foo)
    assert arginfo.is_cached(foo)
Ejemplo n.º 2
0
def test_arginfo_cache():
    def foo(a):
        pass

    assert not arginfo.is_cached(foo)
    arginfo(foo)
    assert arginfo.is_cached(foo)
Ejemplo n.º 3
0
def test_arginfo_cache_callable():
    class Foo(object):
        def __call__(self):
            pass

    foo = Foo()
    assert not arginfo.is_cached(foo)
    arginfo(foo)
    assert arginfo.is_cached(foo)
Ejemplo n.º 4
0
def test_arginfo_cache_callable():
    class Foo(object):
        def __call__(self):
            pass

    foo = Foo()
    assert not arginfo.is_cached(foo)
    arginfo(foo)
    assert arginfo.is_cached(foo)
Ejemplo n.º 5
0
def test_arginfo_builtin():
    info = arginfo(int)
    assert info.args == []
    assert info.varargs is None
    assert info.keywords is None
    assert info.defaults is None
Ejemplo n.º 6
0
def test_arginfo_defaults(callable):
    info = arginfo(callable)
    assert info.args == ['a']
    assert info.varargs is None
    assert info.keywords is None
    assert info.defaults == (1,)
Ejemplo n.º 7
0
def test_arginfo_keywords(callable):
    info = arginfo(callable)
    assert info.args == []
    assert info.varargs is None
    assert info.keywords == 'kw'
    assert info.defaults is None
Ejemplo n.º 8
0
def test_arginfo_builtin():
    info = arginfo(int)
    assert info.args == []
    assert info.varargs is None
    assert info.keywords is None
    assert info.defaults is None
Ejemplo n.º 9
0
def test_arginfo_defaults(callable):
    info = arginfo(callable)
    assert info.args == ['a']
    assert info.varargs is None
    assert info.keywords is None
    assert info.defaults == (1, )
Ejemplo n.º 10
0
def test_arginfo_keywords(callable):
    info = arginfo(callable)
    assert info.args == []
    assert info.varargs is None
    assert info.keywords == 'kw'
    assert info.defaults is None