pep8 compliance

This commit is contained in:
James Kasten
2015-01-13 16:48:18 -08:00
parent d0c9e4fc07
commit ce13ead0cd
8 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -943,7 +943,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
fulfilled by configurator.
:returns: list of responses. All responses are returned in the same
order as received by the perform function. A None response
order as received by the perform function. A None response
indicates the challenge was not perfromed.
:rtype: list
+4 -1
View File
@@ -175,7 +175,7 @@ class AuthHandler(object):
"""Return list of challenge preferences.
:param str domain: domain for which you are requesting preferences
"""
chall_prefs = []
chall_prefs.extend(self.client_auth.get_chall_pref(domain))
@@ -318,6 +318,7 @@ class AuthHandler(object):
raise errors.LetsEncryptClientError(
"Unimplemented Client Challenge: %s" % chall["type"])
def gen_challenge_path(challenges, preferences, combos=None):
"""Generate a plan to get authority over the identity.
@@ -391,6 +392,7 @@ def _find_smart_path(challenges, preferences, combos):
return best_combo
def _find_dumb_path(challenges, preferences):
"""Find challenge path without server hints.
@@ -422,6 +424,7 @@ def _find_dumb_path(challenges, preferences):
return [i for (i, _) in path]
def is_preferred(offered_challenge_type, path):
"""Return whether or not the challenge is preferred in path."""
for _, challenge_type in path:
+1
View File
@@ -24,6 +24,7 @@ PopChall = collections.namedtuple("PopChall", "domain, alg, nonce, hints")
# the response within a larger challenge list
IndexedChall = collections.namedtuple("IndexedChall", "chall, index")
# DVSNI Challenge functions
def dvsni_gen_cert(filepath, name, r_b64, nonce, key):
"""Generate a DVSNI cert and save it to filepath.
@@ -6,6 +6,7 @@ from letsencrypt.client import errors
from letsencrypt.client import interfaces
from letsencrypt.client import recovery_token
class ClientAuthenticator(object):
"""IAuthenticator for CONFIG.CLIENT_CHALLENGES.
@@ -23,8 +23,6 @@ class TwoVhost80Test(unittest.TestCase):
"""Test two standard well configured HTTP vhosts."""
def setUp(self):
#zope.component.provideUtility(display.NcursesDisplay())
self.temp_dir, self.config_dir, self.work_dir = config_util.dir_setup(
"debian_apache_2_4/two_vhost_80")
@@ -18,7 +18,6 @@ class DvsniPerformTest(unittest.TestCase):
def setUp(self):
from letsencrypt.client.apache import dvsni
#zope.component.provideUtility(display.NcursesDisplay())
self.temp_dir, self.config_dir, self.work_dir = config_util.dir_setup(
"debian_apache_2_4/two_vhost_80")
@@ -105,7 +104,7 @@ class DvsniPerformTest(unittest.TestCase):
for chall in self.challs:
expected_call_list.append(
(self.sni.get_cert_file(chall.nonce), chall.domain,
chall.r_b64, chall.nonce, chall.key))
chall.r_b64, chall.nonce, chall.key))
for i in range(len(expected_call_list)):
for j in range(len(expected_call_list[0])):
@@ -1,6 +1,7 @@
"""Test the helper objects in apache.obj.py."""
import unittest
class AddrTest(unittest.TestCase):
"""Test the Addr class."""
def setUp(self):
@@ -363,6 +363,7 @@ class GetAuthorizationsTest(unittest.TestCase):
self.assertFalse(self.handler.paths)
self.assertFalse(self.handler.domains)
# pylint: disable=protected-access
class PathSatisfiedTest(unittest.TestCase):
def setUp(self):
@@ -411,6 +412,7 @@ def gen_auth_resp(chall_list):
return ["%s%s" % (type(chall).__name__, chall.domain)
for chall in chall_list]
def gen_path(str_list, challenges):
path = []
for i, chall in enumerate(challenges):