def test_bookmark_completion(bookmarks): """Test the results of bookmark completion.""" actual = _get_completions(miscmodels.BookmarkCompletionModel()) assert actual == [("Bookmarks", [ ('https://github.com', 'GitHub', ''), ('https://python.org', 'Welcome to Python.org', ''), ('http://qutebrowser.org', 'qutebrowser | qutebrowser', ''), ])]
def init_bookmark_completions(): """Initialize bookmark completion models.""" log.completion.debug("Initializing bookmark completion.") try: _instances[usertypes.Completion.bookmark_by_url].deleteLater() except KeyError: pass model = miscmodels.BookmarkCompletionModel() _instances[usertypes.Completion.bookmark_by_url] = model
def test_bookmark_completion(qtmodeltester, bookmarks): """Test the results of bookmark completion.""" model = miscmodels.BookmarkCompletionModel() qtmodeltester.data_display_may_return_none = True qtmodeltester.check(model) _check_completions(model, { "Bookmarks": [ ('https://github.com', 'GitHub', ''), ('https://python.org', 'Welcome to Python.org', ''), ('http://qutebrowser.org', 'qutebrowser | qutebrowser', ''), ] })