| Current Path : /lib/python3/dist-packages/certbot/plugins/__pycache__/ |
| Current File : //lib/python3/dist-packages/certbot/plugins/__pycache__/manual_test.cpython-38.pyc |
U
�]b � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
ddl mZ ddlm
Z
ddlmZ G d d
� d
ej�Zedkr�e�� dS )z Tests for certbot.plugins.manual� N)�
challenges)�errors)�os)�
filesystem)� acme_util)�utilc s� e Zd ZdZ� fdd�Zdd� Zdd� Zdd � Zd
d� Ze �
� dd
� �Ze �
� dd� �Zdd� Z
e �
� dd� �Zdd� Z� ZS )�AuthenticatorTestz/Tests for certbot.plugins.manual.Authenticator.c s� t t| ��� tj| _tj| _tj| _ | j| j| j g| _
dD ]}t�t
j�| j|�� q<tjdd d dddt
j�| jd�t
j�| jd�t
j�| jd�t
j�| jd�t
j�| jd�d �| _dd
lm} || jdd�| _d S )
N)�
config_dir�work_dirZin_progressr Fr r
�
backup_dir�temp_checkpoint_dirZ
in_progess)Zhttp01_port�manual_auth_hook�manual_cleanup_hook�manual_public_ip_logging_ok�noninteractive_mode�validate_hooksr r
r r Zin_progress_dir)�
AuthenticatorZmanual)�name)�superr �setUpr ZHTTP01_A�http_achallZDNS01_A�
dns_achallZ DNS01_A_2Zdns_achall_2�achallsr �mkdirr �path�joinZtempdir�mockZ MagicMock�configZcertbot.plugins.manualr �auth)�self�dr �� __class__� �=/usr/lib/python3/dist-packages/certbot/plugins/manual_test.pyr s2 ��zAuthenticatorTest.setUpc C s d| j _| �tj| jj� d S �NT)r r �assertRaisesr �PluginErrorr �prepare�r r# r# r$ �#test_prepare_no_hook_noninteractive- s z5AuthenticatorTest.test_prepare_no_hook_noninteractivec C s0 t j�t j�| j_d| j_| �tj | j
j� d S r% )r r �abspath�sepr r
r r&