Correctly handle None

This commit is contained in:
James Kasten 2015-02-24 16:39:26 -08:00
parent 2920e797c9
commit ba8604a3df
3 changed files with 3 additions and 3 deletions

View file

@ -381,7 +381,7 @@ def determine_authenticator(all_auths):
else:
raise errors.LetsEncryptClientError("No Authenticators available.")
if auth and auth in errs:
if auth is not None and auth in errs:
logging.error("Please fix the configuration for the Authenticator. "
"The following error message was received: "
"%s", errs[auth])

View file

@ -59,7 +59,7 @@ class DetermineAuthenticatorTest(unittest.TestCase):
errors.LetsEncryptMisconfigurationError)
mock_choose.return_value = self.mock_apache
self.assertEqual(self._call(self.all_auths), None)
self.assertTrue(self._call(self.all_auths) is None)
class RollbackTest(unittest.TestCase):

View file

@ -51,7 +51,7 @@ class ChooseAuthenticatorTest(unittest.TestCase):
def test_no_choice(self, mock_util):
mock_util().menu.return_value = (display_util.CANCEL, 0)
self.assertEqual(self._call(self.auths, {}), None)
self.assertTrue(self._call(self.auths, {}) is None)
class GenHttpsNamesTest(unittest.TestCase):