summaryrefslogtreecommitdiff
path: root/src/leap/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/crypto')
-rw-r--r--src/leap/crypto/tests/test_certs.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/leap/crypto/tests/test_certs.py b/src/leap/crypto/tests/test_certs.py
index 4d167c51..e476b630 100644
--- a/src/leap/crypto/tests/test_certs.py
+++ b/src/leap/crypto/tests/test_certs.py
@@ -1,10 +1,21 @@
import unittest
+from leap.testing.https_server import where
+from leap.crypto import certs
+
class CertTestCase(unittest.TestCase):
- def test_load_client_and_pkey(self):
- self.fail('not implemented')
+ def test_can_load_client_and_pkey(self):
+ with open(where('leaptestscert.pem')) as cf:
+ cs = cf.read()
+ with open(where('leaptestskey.pem')) as kf:
+ ks = kf.read()
+ certs.can_load_cert_and_pkey(cs + ks)
+
+ with self.assertRaises(certs.BadCertError):
+ # screw header
+ certs.can_load_cert_and_pkey(cs.replace("BEGIN", "BEGINN") + ks)
if __name__ == "__main__":