summaryrefslogtreecommitdiff
path: root/tests/unit/browser/webkit/test_certificateerror.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/browser/webkit/test_certificateerror.py')
-rw-r--r--tests/unit/browser/webkit/test_certificateerror.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/unit/browser/webkit/test_certificateerror.py b/tests/unit/browser/webkit/test_certificateerror.py
index e615854ca..ad6d83262 100644
--- a/tests/unit/browser/webkit/test_certificateerror.py
+++ b/tests/unit/browser/webkit/test_certificateerror.py
@@ -18,7 +18,8 @@
# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
import pytest
-from PyQt5.QtNetwork import QSslError
+from qutebrowser.qt.core import QUrl
+from qutebrowser.qt.network import QSslError
from qutebrowser.browser.webkit import certificateerror
@@ -34,13 +35,13 @@ class FakeError:
@pytest.mark.parametrize('errors, expected', [
(
- [QSslError(QSslError.UnableToGetIssuerCertificate)],
+ [QSslError(QSslError.SslError.UnableToGetIssuerCertificate)],
['<p>The issuer certificate could not be found</p>'],
),
(
[
- QSslError(QSslError.UnableToGetIssuerCertificate),
- QSslError(QSslError.UnableToDecryptCertificateSignature),
+ QSslError(QSslError.SslError.UnableToGetIssuerCertificate),
+ QSslError(QSslError.SslError.UnableToDecryptCertificateSignature),
],
[
'<ul>',
@@ -67,7 +68,8 @@ class FakeError:
],
),
])
-def test_html(errors, expected):
- wrapper = certificateerror.CertificateErrorWrapper(errors)
+def test_html(stubs, errors, expected):
+ reply = stubs.FakeNetworkReply(url=QUrl("https://example.com"))
+ wrapper = certificateerror.CertificateErrorWrapper(reply=reply, errors=errors)
lines = [line.strip() for line in wrapper.html().splitlines() if line.strip()]
assert lines == expected