示例#1
0
def test_positive_simple():
    node = extract_node('func(timeout=1)')
    assert has_timeout(node)
示例#2
0
def test_avoid_false_positives():
    node = extract_node('''
        def func(**kwargs):
            other_func(**kwargs)  #@
        ''')
    assert has_timeout(node)
示例#3
0
def test_negative_simple():
    node = extract_node('func()')
    assert not has_timeout(node)
示例#4
0
def test_negative_unpacked():
    node = extract_node('''
        kwargs = {'xxx': 'yyy'}
        func(**kwargs)
        ''')
    assert not has_timeout(node)
示例#5
0
def test_positive_unpacked():
    node = extract_node('''
        kwargs = {'timeout': 1}
        func(**kwargs)
        ''')
    assert has_timeout(node)