1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00

Improve coverage for perform() error cases

This commit is contained in:
Seth Schoen
2015-02-06 15:28:27 -08:00
parent 5a9e394827
commit 31b1369752

View File

@@ -344,6 +344,18 @@ class PerformTest(unittest.TestCase):
with self.assertRaises(Exception):
self.authenticator.perform([extra_challenge])
def test_perform_without_challenge_list(self):
extra_challenge = DvsniChall("a", "b", "c", "d")
# This is wrong because a challenge must be specified.
with self.assertRaises(Exception):
self.authenticator.perform([])
# This is wrong because it must be a list, not a bare challenge.
with self.assertRaises(Exception):
self.authenticator.perform(extra_challenge)
# This is wrong because the list must contain at least one challenge.
with self.assertRaises(Exception):
self.authenticator.perform(range(20))
class StartListenerTest(unittest.TestCase):
"""Tests for start_listener() method."""