コード例 #1
0
def test_arginfo_cache():
    def foo(a):
        pass

    assert not arginfo.is_cached(foo)
    arginfo(foo)
    assert arginfo.is_cached(foo)
コード例 #2
0
ファイル: test_mapply.py プロジェクト: iapilgrim/reg
def test_arginfo_cache():
    def foo(a):
        pass

    assert not arginfo.is_cached(foo)
    arginfo(foo)
    assert arginfo.is_cached(foo)
コード例 #3
0
ファイル: test_mapply.py プロジェクト: iapilgrim/reg
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)
コード例 #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)
コード例 #5
0
ファイル: test_mapply.py プロジェクト: iapilgrim/reg
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
コード例 #6
0
ファイル: test_mapply.py プロジェクト: iapilgrim/reg
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,)
コード例 #7
0
ファイル: test_mapply.py プロジェクト: iapilgrim/reg
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
コード例 #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
コード例 #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, )
コード例 #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