Add tests to check that configuration is used

The existing tests use the case in which the (configured) supported
challenges are equal to the defaults, and in the same (now-fixed) order.
These additional tests check that, if we have configured a subset of the
supported challenges, then we actually _use_ that configuration.
This commit is contained in:
Joe Ranweiler
2015-12-03 00:13:09 -08:00
parent d5511971aa
commit 8cf47e3aba
+10
View File
@@ -100,6 +100,11 @@ class AuthenticatorTest(unittest.TestCase):
self.assertEqual(self.auth.supported_challenges,
set([challenges.TLSSNI01, challenges.HTTP01]))
def test_supported_challenges_configured(self):
self.config.standalone_supported_challenges = "tls-sni-01"
self.assertEqual(self.auth.supported_challenges,
set([challenges.TLSSNI01]))
def test_more_info(self):
self.assertTrue(isinstance(self.auth.more_info(), six.string_types))
@@ -107,6 +112,11 @@ class AuthenticatorTest(unittest.TestCase):
self.assertEqual(self.auth.get_chall_pref(domain=None),
[challenges.TLSSNI01, challenges.HTTP01])
def test_get_chall_pref_configured(self):
self.config.standalone_supported_challenges = "tls-sni-01"
self.assertEqual(self.auth.get_chall_pref(domain=None),
[challenges.TLSSNI01])
@mock.patch("letsencrypt.plugins.standalone.util")
def test_perform_already_listening(self, mock_util):
for chall, port in ((challenges.TLSSNI01.typ, 1234),