Check CommandError exception value
This commit is contained in:
parent
f4f329714d
commit
9e64e5eab4
@ -249,8 +249,11 @@ def test_without_datadir(config_stub, tmpdir, monkeypatch, win_registry):
|
|||||||
}
|
}
|
||||||
monkeypatch.setattr('qutebrowser.utils.standarddir.data', lambda: None)
|
monkeypatch.setattr('qutebrowser.utils.standarddir.data', lambda: None)
|
||||||
host_blocker = adblock.HostBlocker()
|
host_blocker = adblock.HostBlocker()
|
||||||
with pytest.raises(cmdexc.CommandError):
|
|
||||||
|
with pytest.raises(cmdexc.CommandError) as excinfo:
|
||||||
host_blocker.adblock_update(0)
|
host_blocker.adblock_update(0)
|
||||||
|
assert str(excinfo.value) == "No data storage is configured!"
|
||||||
|
|
||||||
host_blocker.read_hosts()
|
host_blocker.read_hosts()
|
||||||
for str_url in URLS_TO_CHECK:
|
for str_url in URLS_TO_CHECK:
|
||||||
assert not host_blocker.is_blocked(QUrl(str_url))
|
assert not host_blocker.is_blocked(QUrl(str_url))
|
||||||
|
Loading…
Reference in New Issue
Block a user