summaryrefslogtreecommitdiff
path: root/src/leap/crypto/tests/test_certs.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-20 02:50:52 +0900
committerkali <kali@leap.se>2012-12-20 02:50:52 +0900
commite98c3cc5fad75bea038dc67238e5ce85d701b1e1 (patch)
tree343b641ac81a5578cac25628748b0690708d2aa7 /src/leap/crypto/tests/test_certs.py
parent6a8b5c24571251cb39e8d83333b0450e8324dcbe (diff)
fix broken tests
Diffstat (limited to 'src/leap/crypto/tests/test_certs.py')
-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__":