def test_clear_add_tab(self, web_history, mock_time): url = QUrl("http://example.com") web_history.add_from_tab(QUrl(url), QUrl(url), 'title') hist = list(web_history) assert hist history.history_clear(force=True) assert len(web_history) == 0 web_history.add_from_tab(QUrl(url), QUrl(url), 'title') assert list(web_history) == hist
def test_clear(self, qtbot, tmpdir, web_history, mocker): web_history.add_url(QUrl('http://example.com/')) web_history.add_url(QUrl('http://www.qutebrowser.org/')) m = mocker.patch('qutebrowser.browser.history.message.confirm_async', new=mocker.Mock, spec=[]) history.history_clear() assert m.called
def test_clear_force(self, qtbot, tmpdir, web_history): web_history.add_url(QUrl('http://example.com/')) web_history.add_url(QUrl('http://www.qutebrowser.org/')) history.history_clear(force=True) assert not len(web_history) assert not len(web_history.completion)