mirror of
https://github.com/certbot/certbot.git
synced 2026-07-26 07:39:52 +02:00
plugin_ep.problem unittests
and some misc style things
This commit is contained in:
+2
-2
@@ -351,8 +351,8 @@ def diagnose_configurator_problem(cfg_type, requested, plugins):
|
||||
msg = "The requested {0} plugin does not appear to be installed".format(requested)
|
||||
else:
|
||||
msg = ("The {0} plugin is not working; there may be problems with "
|
||||
"your existing configuration.\nThe error was: {1}"
|
||||
.format(requested, `plugins[requested].problem`))
|
||||
"your existing configuration.\nThe error was: {1!r}"
|
||||
.format(requested, plugins[requested].problem))
|
||||
elif cfg_type == "installer":
|
||||
if os.path.exists("/etc/debian_version"):
|
||||
# Debian... installers are at least possible
|
||||
|
||||
@@ -125,6 +125,7 @@ class PluginEntryPoint(object):
|
||||
"""Return the Exception raised during plugin setup, or None if all is well"""
|
||||
if isinstance(self._prepared, Exception):
|
||||
return self._prepared
|
||||
return None
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
|
||||
@@ -68,6 +68,7 @@ class PluginEntryPointTest(unittest.TestCase):
|
||||
self.assertFalse(self.plugin_ep.prepared)
|
||||
self.assertFalse(self.plugin_ep.misconfigured)
|
||||
self.assertFalse(self.plugin_ep.available)
|
||||
self.assertTrue(self.plugin_ep.problem is None)
|
||||
self.assertTrue(self.plugin_ep.entry_point is EP_SA)
|
||||
self.assertEqual("sa", self.plugin_ep.name)
|
||||
|
||||
@@ -131,6 +132,8 @@ class PluginEntryPointTest(unittest.TestCase):
|
||||
errors.MisconfigurationError))
|
||||
self.assertTrue(self.plugin_ep.prepared)
|
||||
self.assertTrue(self.plugin_ep.misconfigured)
|
||||
self.assertTrue(isinstance(self.plugin_ep.problem,
|
||||
errors.MisconfigurationError))
|
||||
self.assertTrue(self.plugin_ep.available)
|
||||
|
||||
def test_prepare_no_installation(self):
|
||||
|
||||
Reference in New Issue
Block a user