mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Merge remote-tracking branch 'origin/master' into multi-topic-help
This commit is contained in:
@@ -255,4 +255,4 @@ class PluginsRegistry(collections.Mapping):
|
||||
def __str__(self):
|
||||
if not self._plugins:
|
||||
return "No plugins"
|
||||
return "\n\n".join(str(p_ep) for p_ep in self._plugins.itervalues())
|
||||
return "\n\n".join(str(p_ep) for p_ep in six.itervalues(self._plugins))
|
||||
|
||||
@@ -3,6 +3,7 @@ import unittest
|
||||
|
||||
import mock
|
||||
import pkg_resources
|
||||
import six
|
||||
import zope.interface
|
||||
|
||||
from certbot import errors
|
||||
@@ -50,7 +51,7 @@ class PluginEntryPointTest(unittest.TestCase):
|
||||
EP_SA: "sa",
|
||||
}
|
||||
|
||||
for entry_point, name in names.iteritems():
|
||||
for entry_point, name in six.iteritems(names):
|
||||
self.assertEqual(
|
||||
name, PluginEntryPoint.entry_point_to_plugin_name(entry_point))
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class AuthenticatorTest(unittest.TestCase):
|
||||
@mock.patch("certbot.plugins.manual.zope.component.getUtility")
|
||||
@mock.patch("certbot.plugins.manual.sys.stdout")
|
||||
@mock.patch("acme.challenges.HTTP01Response.simple_verify")
|
||||
@mock.patch("__builtin__.raw_input")
|
||||
@mock.patch("six.moves.input")
|
||||
def test_perform(self, mock_raw_input, mock_verify, mock_stdout, mock_interaction):
|
||||
mock_verify.return_value = True
|
||||
mock_interaction().yesno.return_value = True
|
||||
|
||||
@@ -4,6 +4,7 @@ from __future__ import print_function
|
||||
import os
|
||||
import logging
|
||||
|
||||
import six
|
||||
import zope.component
|
||||
|
||||
from certbot import errors
|
||||
@@ -78,7 +79,7 @@ def pick_plugin(config, default, plugins, question, ifaces):
|
||||
|
||||
if len(prepared) > 1:
|
||||
logger.debug("Multiple candidate plugins: %s", prepared)
|
||||
plugin_ep = choose_plugin(prepared.values(), question)
|
||||
plugin_ep = choose_plugin(list(six.itervalues(prepared)), question)
|
||||
if plugin_ep is None:
|
||||
return None
|
||||
else:
|
||||
|
||||
@@ -63,7 +63,7 @@ class AlreadyListeningTestNoPsutil(unittest.TestCase):
|
||||
def test_ports_available(self, mock_getutil):
|
||||
import certbot.plugins.util as plugins_util
|
||||
# Ensure we don't get error
|
||||
with mock.patch("socket._socketobject.bind"):
|
||||
with mock.patch("socket.socket.bind"):
|
||||
self.assertFalse(plugins_util.already_listening(80))
|
||||
self.assertFalse(plugins_util.already_listening(80, True))
|
||||
self.assertEqual(mock_getutil.call_count, 0)
|
||||
@@ -73,7 +73,7 @@ class AlreadyListeningTestNoPsutil(unittest.TestCase):
|
||||
sys.modules["psutil"] = None
|
||||
import certbot.plugins.util as plugins_util
|
||||
import socket
|
||||
with mock.patch("socket._socketobject.bind", side_effect=socket.error):
|
||||
with mock.patch("socket.socket.bind", side_effect=socket.error):
|
||||
self.assertTrue(plugins_util.already_listening(80))
|
||||
self.assertTrue(plugins_util.already_listening(80, True))
|
||||
with mock.patch("socket.socket", side_effect=socket.error):
|
||||
|
||||
@@ -206,7 +206,7 @@ to serve all files under specified web root ({0})."""
|
||||
old_umask = os.umask(0o022)
|
||||
|
||||
try:
|
||||
with open(validation_path, "w") as validation_file:
|
||||
with open(validation_path, "wb") as validation_file:
|
||||
validation_file.write(validation.encode())
|
||||
finally:
|
||||
os.umask(old_umask)
|
||||
|
||||
Reference in New Issue
Block a user