def test_complete(magic, patch):
    patch.init(Document)
    patch.many(Document, ['line_to_cursor', 'word_to_cursor'])
    patch.many(CompletionContext, ['_blocks'])
    cache = magic()
    c = Completion(plugins=[], context_cache=cache)
    doc = Document()
    ws = magic()
    pos = magic()
    result = c.complete(ws, doc, pos)
    assert isinstance(cache.update.call_args[0][0], CompletionContext)
    assert (result == {'isIncomplete': False, 'items': []})
def test_complete(magic, patch):
    patch.init(Document)
    patch.many(Document, ['line_to_cursor', 'word_to_cursor'])
    patch.many(CompletionContext, ['_blocks'])
    cache = magic()
    c = Completion(plugins=[], context_cache=cache)
    doc = Document()
    ws = magic()
    pos = magic()
    result = c.complete(ws, doc, pos)
    assert isinstance(cache.update.call_args[0][0], CompletionContext)
    assert (result == {'isIncomplete': False, 'items': []})