mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:14:54 +02:00
crypto_util: test _pyopenssl_load
This commit is contained in:
@@ -212,6 +212,17 @@ class GetSANsFromCSRTest(unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
[], self._call(test_util.load_vector('csr-nosans.pem')))
|
[], self._call(test_util.load_vector('csr-nosans.pem')))
|
||||||
|
|
||||||
|
class PyOpenSslLoaderTest(unittest.TestCase):
|
||||||
|
def test_pyopenssl_load(self):
|
||||||
|
from letsencrypt.crypto_util import _pyopenssl_load
|
||||||
|
|
||||||
|
method_mock = mock.MagicMock()
|
||||||
|
fake_data = "this is test data"
|
||||||
|
fake_types = ('fake loading type',)
|
||||||
|
_pyopenssl_load(fake_data, method_mock, fake_types)
|
||||||
|
method_mock.assert_called_with(fake_types[0], fake_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main() # pragma: no cover
|
unittest.main() # pragma: no cover
|
||||||
|
|||||||
Reference in New Issue
Block a user