Correct test_config_change

This commit is contained in:
Corentin Julé 2016-01-23 16:34:05 +01:00
parent 47261dbd30
commit 6fd8dc4e57

View File

@ -50,9 +50,10 @@ URLS_TO_CHECK = ('http://localhost',
'http://4-verybadhost.com',
'http://ads.worsthostever.net',
'http://goodhost.gov',
'ftp://verygoodhost.com'
'ftp://verygoodhost.com',
'http://qutebrowser.org')
@pytest.fixture
def data_tmpdir(monkeypatch, tmpdir):
"""Set tmpdir as datadir"""
@ -355,12 +356,12 @@ def test_config_change(config_stub, basedir, download_stub,
data_tmpdir, tmpdir):
"""Ensure blocked-hosts resets if host-block-list is changed to None."""
filtered_blocked_hosts = BLOCKLIST_HOSTS[1:] # Exclude localhost
blocklist = create_blocklist(tmpdir,
blocklist = QUrl(create_blocklist(tmpdir,
blocked_hosts=filtered_blocked_hosts,
name='blocked-hosts',
line_format='one_per_line')
line_format='one_per_line'))
config_stub.data = {'content':
{'host-block-lists': [],
{'host-block-lists': [blocklist],
'host-blocking-enabled': True,
'host-blocking-whitelist': None}}
host_blocker = adblock.HostBlocker()