Fix focusing on editor after leaving the app and returning. More code coverage and removing obsolete bits of code
This commit is contained in:
parent
74177f2cd3
commit
aad1ba5d7d
16 changed files with 264 additions and 100 deletions
15
tests/test_search_edgecase.py
Normal file
15
tests/test_search_edgecase.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from bouquin.search import Search as SearchWidget
|
||||
|
||||
|
||||
class DummyDB:
|
||||
def search_entries(self, q):
|
||||
return []
|
||||
|
||||
|
||||
def test_make_html_snippet_no_match_triggers_start_window(qtbot):
|
||||
w = SearchWidget(db=DummyDB())
|
||||
qtbot.addWidget(w)
|
||||
html = "<p>" + ("x" * 300) + "</p>" # long text, no token present
|
||||
frag, left, right = w._make_html_snippet(html, "notfound", radius=10, maxlen=80)
|
||||
assert frag != ""
|
||||
assert left is False and right is True
|
||||
Loading…
Add table
Add a link
Reference in a new issue