Fix testing with error pastebin_version()
This commit is contained in:
parent
942dca3444
commit
e349af7524
@ -1001,7 +1001,7 @@ def test_pastebin_version(pbclient, monkeypatch):
|
|||||||
assert version.pastebin_url == "test"
|
assert version.pastebin_url == "test"
|
||||||
|
|
||||||
|
|
||||||
def test_pastebin_version_error(pbclient, monkeypatch):
|
def test_pastebin_version_error(pbclient, caplog, monkeypatch):
|
||||||
"""Test version.pastebin_version() with errors."""
|
"""Test version.pastebin_version() with errors."""
|
||||||
patches = {
|
patches = {
|
||||||
'_path_info': lambda: {'PATH DESC': 'PATH NAME'},
|
'_path_info': lambda: {'PATH DESC': 'PATH NAME'},
|
||||||
@ -1012,8 +1012,8 @@ def test_pastebin_version_error(pbclient, monkeypatch):
|
|||||||
monkeypatch.setattr('qutebrowser.utils.version.' + name, val)
|
monkeypatch.setattr('qutebrowser.utils.version.' + name, val)
|
||||||
|
|
||||||
version.pastebin_url = None
|
version.pastebin_url = None
|
||||||
version.pastebin_version(pbclient)
|
with caplog.at_level(logging.ERROR):
|
||||||
try:
|
version.pastebin_version(pbclient)
|
||||||
pbclient.error.emit("test")
|
pbclient._client.error.emit("test")
|
||||||
except:
|
assert version.pastebin_url is None
|
||||||
assert version.pastebin_url is None
|
assert caplog.records[0].message == "Failed to pastebin version info: test"
|
||||||
|
Loading…
Reference in New Issue
Block a user