Add tests for make_key

This commit is contained in:
Jakub Warmuz
2014-12-12 11:18:44 +01:00
parent ccfeef3e8e
commit 44a050a061
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ def csr_matches_pubkey(csr, privkey):
def make_key(bits=CONFIG.RSA_KEY_SIZE):
"""Generate PEM encoded RSA key.
:param int bits: Number of bits.
:param int bits: Number of bits, at least 1024.
:returns: new RSA key in PEM form with specified number of bits
:rtype: str
@@ -112,6 +112,14 @@ class CSRMatchesPubkeyTest(unittest.TestCase):
self.assertFalse(self._call_testdata('csr.pem', RSA512_KEY))
class MakeKeyTest(unittest.TestCase):
"""Tests for letsencrypt.client.crypto_util.make_key."""
def test_it(self):
from letsencrypt.client.crypto_util import make_key
M2Crypto.RSA.load_key_string(make_key(1024))
class ValidPrivkeyTest(unittest.TestCase):
"""Tests for letsencrypt.client.crypto_util.valid_privkey."""