def test_tab_completion_delete(qtmodeltester, fake_web_tab, qtbot, app_stub, win_registry, tabbed_browser_stubs):
 tabbed_browser_stubs[0].tabs = [fake_web_tab(QUrl('https://github.com'), 'GitHub', 0), fake_web_tab(QUrl('https://wikipedia.org'), 'Wikipedia', 1), fake_web_tab(QUrl('https://duckduckgo.com'), 'DuckDuckGo', 2)]
 tabbed_browser_stubs[1].tabs = [fake_web_tab(QUrl('https://wiki.archlinux.org'), 'ArchWiki', 0)]
 model = miscmodels.TabCompletionModel()
 qtmodeltester.data_display_may_return_none = True
 qtmodeltester.check(model)
 view = _mock_view_index(model, 0, 1, qtbot)
 qtbot.add_widget(view)
 model.delete_cur_item(view)
 actual = [tab.url() for tab in tabbed_browser_stubs[0].tabs]
 assert (actual == [QUrl('https://github.com'), QUrl('https://duckduckgo.com')])

def test_tab_completion_delete ( qtmodeltester , fake_web_tab , qtbot , app_stub , win_registry , tabbed_browser_stubs ) : tabbed_browser_stubs [ 0 ] . tabs = [ fake_web_tab ( QUrl ( 'https://github.com' ) , 'GitHub' , 0 ) , fake_web_tab ( QUrl ( 'https://wikipedia.org' ) , 'Wikipedia' , 1 ) , fake_web_tab ( QUrl ( 'https://duckduckgo.com' ) , 'DuckDuckGo' , 2 ) ] tabbed_browser_stubs [ 1 ] . tabs = [ fake_web_tab ( QUrl ( 'https://wiki.archlinux.org' ) , 'ArchWiki' , 0 ) ] model = miscmodels . TabCompletionModel ( ) qtmodeltester . data_display_may_return_none = True qtmodeltester . check ( model ) view = _mock_view_index ( model , 0 , 1 , qtbot ) qtbot . add_widget ( view ) model . delete_cur_item ( view ) actual = [ tab . url ( ) for tab in tabbed_browser_stubs [ 0 ] . tabs ] assert ( actual == [ QUrl ( 'https://github.com' ) , QUrl ( 'https://duckduckgo.com' ) ] )
verify closing a tab by deleting it from the completion widget .