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.py74
1 files changed, 39 insertions, 35 deletions
diff --git a/tests/unit/browser/webkit/test_certificateerror.py b/tests/unit/browser/webkit/test_certificateerror.py
index 26bdb1b3b..5a5c4c4bd 100644
--- a/tests/unit/browser/webkit/test_certificateerror.py
+++ b/tests/unit/browser/webkit/test_certificateerror.py
@@ -32,41 +32,45 @@ class FakeError:
return self.msg
-@pytest.mark.parametrize('errors, expected', [
- (
- [QtNetwork.QSslError(QtNetwork.QSslError.UnableToGetIssuerCertificate)],
- ['<p>The issuer certificate could not be found</p>'],
- ),
- (
- [
- QtNetwork.QSslError(QtNetwork.QSslError.UnableToGetIssuerCertificate),
- QtNetwork.QSslError(QtNetwork.QSslError.UnableToDecryptCertificateSignature),
- ],
- [
- '<ul>',
- '<li>The issuer certificate could not be found</li>',
- '<li>The certificate signature could not be decrypted</li>',
- '</ul>',
- ],
- ),
-
- (
- [FakeError('Escaping test: <>')],
- ['<p>Escaping test: &lt;&gt;</p>'],
- ),
- (
- [
- FakeError('Escaping test 1: <>'),
- FakeError('Escaping test 2: <>'),
- ],
- [
- '<ul>',
- '<li>Escaping test 1: &lt;&gt;</li>',
- '<li>Escaping test 2: &lt;&gt;</li>',
- '</ul>',
- ],
- ),
-])
+@pytest.mark.parametrize(
+ 'errors, expected',
+ [
+ (
+ [QtNetwork.QSslError(QtNetwork.QSslError.UnableToGetIssuerCertificate)],
+ ['<p>The issuer certificate could not be found</p>'],
+ ),
+ (
+ [
+ QtNetwork.QSslError(QtNetwork.QSslError.UnableToGetIssuerCertificate),
+ QtNetwork.QSslError(
+ QtNetwork.QSslError.UnableToDecryptCertificateSignature
+ ),
+ ],
+ [
+ '<ul>',
+ '<li>The issuer certificate could not be found</li>',
+ '<li>The certificate signature could not be decrypted</li>',
+ '</ul>',
+ ],
+ ),
+ (
+ [FakeError('Escaping test: <>')],
+ ['<p>Escaping test: &lt;&gt;</p>'],
+ ),
+ (
+ [
+ FakeError('Escaping test 1: <>'),
+ FakeError('Escaping test 2: <>'),
+ ],
+ [
+ '<ul>',
+ '<li>Escaping test 1: &lt;&gt;</li>',
+ '<li>Escaping test 2: &lt;&gt;</li>',
+ '</ul>',
+ ],
+ ),
+ ],
+)
def test_html(errors, expected):
wrapper = certificateerror.CertificateErrorWrapper(errors)
lines = [line.strip() for line in wrapper.html().splitlines() if line.strip()]