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