Refining code and documentation

This commit is contained in:
Amjad Mashaal
2016-03-21 23:43:38 +02:00
parent 6f25005559
commit a8350ce04a
3 changed files with 7 additions and 8 deletions
+3 -4
View File
@@ -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")
+3 -3
View File
@@ -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(
+1 -1
View File
@@ -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