diff --git a/letsencrypt/client/tests/client_authenticator_test.py b/letsencrypt/client/tests/client_authenticator_test.py index 83a7d50d8..c79f26e0a 100644 --- a/letsencrypt/client/tests/client_authenticator_test.py +++ b/letsencrypt/client/tests/client_authenticator_test.py @@ -41,6 +41,10 @@ class PerformTest(unittest.TestCase): self.assertRaises( errors.LetsEncryptClientAuthError, self.auth.perform, [unexpected]) + def test_chall_pref(self): + self.assertEqual( + self.auth.get_chall_pref("example.com"), ["recoveryToken"]) + class CleanupTest(unittest.TestCase): """Test the Authenticator cleanup function.""" diff --git a/letsencrypt/client/tests/recovery_token_test.py b/letsencrypt/client/tests/recovery_token_test.py index 94445a798..0a49137d8 100644 --- a/letsencrypt/client/tests/recovery_token_test.py +++ b/letsencrypt/client/tests/recovery_token_test.py @@ -42,6 +42,11 @@ class RecoveryTokenTest(unittest.TestCase): # Shouldn't throw an error self.rec_token.cleanup(challenge_util.RecTokenChall("example4.com")) + # SHOULD throw an error (OSError other than nonexistent file) + self.assertRaises( + OSError, self.rec_token.cleanup, + challenge_util.RecTokenChall("a"+"r"*10000+".com")) + def test_perform_stored(self): self.rec_token.store_token("example4.com", 444) response = self.rec_token.perform(