Coverage for certbot/plugins/manual_test.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Tests for certbot.plugins.manual"""
"""Tests for certbot.plugins.manual.Authenticator."""
# "backup_dir" and "temp_checkpoint_dir" get created in # certbot.util.make_or_verify_dir() during the Reverter # initialization. http01_port=0, manual_auth_hook=None, manual_cleanup_hook=None, manual_public_ip_logging_ok=False, noninteractive_mode=False, validate_hooks=False, config_dir=os.path.join(self.tempdir, "config_dir"), work_dir=os.path.join(self.tempdir, "work_dir"), backup_dir=os.path.join(self.tempdir, "backup_dir"), temp_checkpoint_dir=os.path.join( self.tempdir, "temp_checkpoint_dir"), in_progress_dir=os.path.join(self.tempdir, "in_progess"), tls_sni_01_port=5001)
[challenges.HTTP01, challenges.DNS01, challenges.TLSSNI01])
def test_ip_logging_not_ok(self, mock_get_utility):
def test_ip_logging_ok(self, mock_get_utility):
'{0} -c "from __future__ import print_function;' 'import os; print(os.environ.get(\'CERTBOT_DOMAIN\'));' 'print(os.environ.get(\'CERTBOT_TOKEN\', \'notoken\'));' 'print(os.environ.get(\'CERTBOT_CERT_PATH\', \'nocert\'));' 'print(os.environ.get(\'CERTBOT_KEY_PATH\', \'nokey\'));' 'print(os.environ.get(\'CERTBOT_SNI_DOMAIN\', \'nosnidomain\'));' 'print(os.environ.get(\'CERTBOT_VALIDATION\', \'novalidation\'));"' .format(sys.executable)) self.dns_achall.domain, 'notoken', 'nocert', 'nokey', 'nosnidomain', self.dns_achall.validation(self.dns_achall.account_key)) self.http_achall.domain, self.http_achall.chall.encode('token'), 'nocert', 'nokey', 'nosnidomain', self.http_achall.validation(self.http_achall.account_key))
self.auth.perform(self.achalls), [achall.response(achall.account_key) for achall in self.achalls]) self.auth.env[self.dns_achall]['CERTBOT_AUTH_OUTPUT'], dns_expected) self.auth.env[self.http_achall]['CERTBOT_AUTH_OUTPUT'], http_expected) # tls_sni_01 challenge must be perform()ed above before we can # get the cert_path and key_path. self.tls_sni_achall.domain, 'notoken', self.auth.tls_sni_01.get_cert_path(self.tls_sni_achall), self.auth.tls_sni_01.get_key_path(self.tls_sni_achall), self.auth.tls_sni_01.get_z_domain(self.tls_sni_achall), 'novalidation') self.auth.env[self.tls_sni_achall]['CERTBOT_AUTH_OUTPUT'], tls_sni_expected)
def test_manual_perform(self, mock_get_utility): self.auth.perform(self.achalls), [achall.response(achall.account_key) for achall in self.achalls]) self.auth.tls_sni_01.get_cert_path( self.tls_sni_achall) in args[0]) else: achall.validation(achall.account_key) in args[0])
def test_cleanup(self):
isinstance(achall.chall, challenges.DNS01)): os.environ['CERTBOT_VALIDATION'], achall.validation(achall.account_key)) os.environ['CERTBOT_TOKEN'], achall.chall.encode('token')) else: os.environ['CERTBOT_CERT_PATH'], self.auth.tls_sni_01.get_cert_path(achall)) os.environ['CERTBOT_KEY_PATH'], self.auth.tls_sni_01.get_key_path(achall)) os.path.exists(os.environ['CERTBOT_CERT_PATH'])) os.path.exists(os.environ['CERTBOT_KEY_PATH']))
unittest.main() # pragma: no cover |