Merge branch 'test_short_dict' of https://github.com/julianuu/qutebrowser into julianuu-test_short_dict

This commit is contained in:
Florian Bruhin 2016-08-11 19:31:39 +02:00
commit cd0b5e6889
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Many links</title>
</head>
<body>
<a href="/data/hello.txt">1</a>
<a href="/data/hello2.txt">2</a>
<a href="/data/hello3.txt">3</a>
</body>
</html>

View File

@ -113,3 +113,20 @@ def test_word_hints_issue1393(quteproc, tmpdir):
quteproc.wait_for(message='hints: *', category='hints')
quteproc.send_cmd(':follow-hint {}'.format(hint))
quteproc.wait_for_load_finished('data/{}'.format(target))
def test_short_dict(quteproc, tmpdir):
dict_file = tmpdir / 'dict'
dict_file.write(textwrap.dedent("""
worda
wordb
"""))
quteproc.set_setting('hints', 'mode', 'word')
quteproc.set_setting('hints', 'dictionary', str(dict_file))
quteproc.open_path('data/hints/short_dict.html')
quteproc.send_cmd(':hint')
line = quteproc.wait_for(message='Not enough words in the dictionary.')
line.expected = True
quteproc.wait_for(message='hints: *', category='hints')
quteproc.send_cmd(':follow-hint d')
quteproc.wait_for_load_finished('data/hello3.txt')