diff --git a/tests/unit/misc/test_autoupdate.py b/tests/unit/misc/test_autoupdate.py index cda2d6a5a..f03db7bec 100644 --- a/tests/unit/misc/test_autoupdate.py +++ b/tests/unit/misc/test_autoupdate.py @@ -21,6 +21,7 @@ import pytest from PyQt5.QtTest import QSignalSpy +from PyQt5.QtCore import QUrl from qutebrowser.misc import autoupdate, httpclient @@ -31,6 +32,7 @@ class HTTPGetStub(httpclient.HTTPClient): """A stub class for HTTPClient. Attributes: + url: the last url used by get() _success: Wether get() will emit a success signal. """ @@ -43,6 +45,7 @@ class HTTPGetStub(httpclient.HTTPClient): self._json = '{"info": {"version": "test"}}' def get(self, url): + self.url = url if self._success: self.success.emit(self._json) else: @@ -67,6 +70,8 @@ def test_get_version_success(qtbot): assert len(error_spy) == 0 + assert http_stub.url == QUrl('https://pypi.python.org/pypi/test/json') + def test_get_version_error(qtbot): """Test get_version() when error is emitted."""