test_completer.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:blender 作者: gastrodia 项目源码 文件源码
def test_greedy_completions():
    ip = get_ipython()
    ip.ex('a=list(range(5))')
    _,c = ip.complete('.',line='a[0].')
    nt.assert_false('.real' in c,
                    "Shouldn't have completed on a[0]: %s"%c)
    with greedy_completion():
        def _(line, cursor_pos, expect, message):
            _,c = ip.complete('.', line=line, cursor_pos=cursor_pos)
            nt.assert_in(expect, c, message%c)

        yield _, 'a[0].', 5, 'a[0].real', "Should have completed on a[0].: %s"
        yield _, 'a[0].r', 6, 'a[0].real', "Should have completed on a[0].r: %s"

        if sys.version_info > (3,4):
            yield _, 'a[0].from_', 10, 'a[0].from_bytes', "Should have completed on a[0].from_: %s"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号