mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:05:31 +02:00
Refining code and documentation
This commit is contained in:
@@ -52,9 +52,8 @@ class AuthHandler(object):
|
||||
:param bool best_effort: Whether or not all authorizations are
|
||||
required (this is useful in renewal)
|
||||
|
||||
:returns: tuple of lists of authorization resources. Takes the
|
||||
form of (`completed`, `failed`)
|
||||
:rtype: tuple
|
||||
:returns: List of authorization resources
|
||||
:rtype: list
|
||||
|
||||
:raises .AuthorizationError: If unable to retrieve all
|
||||
authorizations
|
||||
@@ -81,7 +80,7 @@ class AuthHandler(object):
|
||||
retVal = [authzr for authzr in self.authzr.values()
|
||||
if authzr.body.status == messages.STATUS_VALID]
|
||||
|
||||
if len(retVal) <= 0:
|
||||
if not retVal:
|
||||
raise errors.AuthorizationError(
|
||||
"Challenges failed for all domains")
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ class Client(object):
|
||||
:param .le_util.CSR csr: DER-encoded Certificate Signing
|
||||
Request. The key used to generate this CSR can be different
|
||||
than `authkey`.
|
||||
:param dict authzr: ACME Authorization Resource dict where keys are
|
||||
:param list authzr: ACME Authorization Resource dict where keys are
|
||||
domains and values are :class:`acme.messages.AuthorizationResource`
|
||||
|
||||
:returns: `.CertificateResource` and certificate chain (as
|
||||
@@ -244,8 +244,8 @@ class Client(object):
|
||||
domains,
|
||||
self.config.allow_subset_of_names)
|
||||
|
||||
domains = [a.body.identifier.value.encode('ascii', 'ignore')
|
||||
for a in authzr]
|
||||
domains = [a.body.identifier.value.encode('ascii')
|
||||
for a in authzr]
|
||||
|
||||
# Create CSR from names
|
||||
key = crypto_util.init_save_key(
|
||||
|
||||
@@ -115,7 +115,7 @@ class ClientTest(unittest.TestCase):
|
||||
|
||||
def _mock_obtain_certificate(self):
|
||||
self.client.auth_handler = mock.MagicMock()
|
||||
self.client.auth_handler.get_authorizations.return_value = (None, None)
|
||||
self.client.auth_handler.get_authorizations.return_value = [None]
|
||||
self.acme.request_issuance.return_value = mock.sentinel.certr
|
||||
self.acme.fetch_chain.return_value = mock.sentinel.chain
|
||||
|
||||
|
||||
Reference in New Issue
Block a user