mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 15:22:38 -04:00
Start import_csr_file tests
This commit is contained in:
parent
53286863fe
commit
a48afd498c
1 changed files with 22 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import zope.component
|
|||
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
from certbot import le_util
|
||||
from certbot.tests import test_util
|
||||
|
||||
|
||||
|
|
@ -159,6 +160,27 @@ class CSRMatchesPubkeyTest(unittest.TestCase):
|
|||
test_util.load_vector('csr.pem'), RSA256_KEY))
|
||||
|
||||
|
||||
class ImportCSRFileTest(unittest.TestCase):
|
||||
"""Tests for certbot.certbot_util.import_csr_file."""
|
||||
|
||||
@classmethod
|
||||
def _call(cls, *args, **kwargs):
|
||||
from certbot.crypto_util import import_csr_file
|
||||
return import_csr_file(*args, **kwargs)
|
||||
|
||||
def test_der_csr(self):
|
||||
csrfile = test_util.vector_path('csr.der')
|
||||
data = test_util.load_vector('csr.der')
|
||||
|
||||
self.assertEqual(
|
||||
(OpenSSL.crypto.FILETYPE_ASN1,
|
||||
le_util.CSR(file=csrfile,
|
||||
data=data,
|
||||
form="der"),
|
||||
["example.com"],),
|
||||
self._call(csrfile, data))
|
||||
|
||||
|
||||
class MakeKeyTest(unittest.TestCase): # pylint: disable=too-few-public-methods
|
||||
"""Tests for certbot.crypto_util.make_key."""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue