Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/certbot/plugins/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/certbot/plugins/__pycache__/util_test.cpython-38.pyc

U

�]:�@sXdZddlZddlZddlmZGdd�dej�ZGdd�dej�ZedkrTe�	�dS)	zTests for certbot.plugins.util.�N)�osc@seZdZdZdd�ZdS)�
GetPrefixTestz'Tests for certbot.plugins.get_prefixes.cCsVddlm}|�|d�dd�dD��|�|d�tj�d�g�|�|d�dg�dS)	Nr)�get_prefixes�/a/b/ccSsg|]}tj�|��qS�)r�path�normpath)�.0rrr�;/usr/lib/python3/dist-packages/certbot/plugins/util_test.py�
<listcomp>sz1GetPrefixTest.test_get_prefix.<locals>.<listcomp>)rz/a/bz/a�/r�a)�certbot.plugins.utilr�assertEqualrrr)�selfrrrr
�test_get_prefixs�zGetPrefixTest.test_get_prefixN)�__name__�
__module__�__qualname__�__doc__rrrrr
r	src@s"eZdZdZe�d�dd��ZdS)�PathSurgeryTestz'Tests for certbot.plugins.path_surgery.z!certbot.plugins.util.logger.debugc
Csddlm}ddi}tj�d|��Vt�d��@}d|_|�|d�d�|�|jd�|�tj	d|d�W5QRXW5QRXtj
d	k�rdd
i}tj�d|��j|d�|�|jtj
d	kr�dnd
�|�d|jddk�|�dtj	dk�|�dtj	dk�W5QRXdS)Nr)�path_surgery�PATHz0/usr/local/bin:/bin/:/usr/sbin/:/usr/local/sbin/z
os.environzcertbot.util.exe_existsTZeg�ntz/tmp/Zthingy��zFailed to findz/usr/local/binz/tmp)
rr�mock�patch�dictZreturn_valuerZ
call_countr�environ�nameZ
assertTrueZ	call_args)rZ
mock_debugrZall_pathZmock_existsZno_pathrrr
�test_path_surgerys *z!PathSurgeryTest.test_path_surgeryN)rrrrrrr!rrrr
rsr�__main__)
rZunittestrZcertbot.compatrZTestCaserrr�mainrrrr
�<module>s