mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-12 16:32:01 -05:00
tests: add test for PEM certificate files with leading text
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
1 parent
066f5b7c90
commit
89dfbab3ca
1 file changed
+11
@@ -69,6 +69,17 @@ class test_x509(object):
|
||||
x509.load_certificate((newcert,))
|
||||
x509.load_certificate([newcert])
|
||||
|
||||
# Load a good cert with headers and leading text
|
||||
newcert = (
|
||||
'leading text\n-----BEGIN CERTIFICATE-----' +
|
||||
goodcert +
|
||||
'-----END CERTIFICATE-----')
|
||||
x509.load_certificate(newcert)
|
||||
|
||||
# Should handle list/tuple
|
||||
x509.load_certificate((newcert,))
|
||||
x509.load_certificate([newcert])
|
||||
|
||||
# Load a good cert with bad headers
|
||||
newcert = '-----BEGIN CERTIFICATE-----' + goodcert
|
||||
with pytest.raises((TypeError, ValueError)):
|
||||
|
||||
Reference in new issue
Block a user