tests: Make check for ddg being loaded less strict

Before this change, adding a new logging message involving logging e.g. the
default duckduckgo setting value failed.

Now we basically use a black- instead of a whitelist and only fail if we get a
load status message for duckduckgo.
This commit is contained in:
Florian Bruhin 2016-02-27 02:14:34 +01:00
parent 2e12fb3c65
commit 83e86706ff

View File

@ -264,12 +264,12 @@ class QuteProc(testprocess.Process):
testutils.pattern_match(pattern='[*] [FAIL] *',
value=msg.message))
# Try to complain about the most common mistake when accidentally
# loading external resources. A fuzzy_url line gets logged when
# initializing settings though, so ignore those.
is_ddg_page = (
'duckduckgo' in msg.message and not (msg.module == 'urlutils' and
msg.function == 'fuzzy_url'))
return msg.loglevel > logging.INFO or is_js_error or is_ddg_page
# loading external resources.
is_ddg_load = testutils.pattern_match(
pattern="load status for <qutebrowser.browser.webview.WebView "
"tab_id=* url='*duckduckgo*'>: *",
value=msg.message)
return msg.loglevel > logging.INFO or is_js_error or is_ddg_load
def _maybe_skip(self):
"""Skip the test if [SKIP] lines were logged."""