HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/test_tools/__pycache__/test_md5sum.cpython-310.pyc
o

�i�
�@s�dZddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZmZe�ej
ddd	�Gd
d�dej��ZedkrGe��dSdS)
z3Tests for the md5sum script in the Tools directory.�N)�	os_helper)�hashlib_helper)�assert_python_ok�assert_python_failure)�
scriptsdir�skip_if_missing�md5T)Zopensslc@s\eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�MD5SumTestscCsttj�td�|_t�tj�tj�tjd�|_t	|jd��
}|�
d�Wd�n1s-wYd|_d|_dS)Nz	md5sum.pyz
md5sum.fodder�wbsmd5sum
test file
s d38dae2eb1ab346a292ef6850f9e1a0ds a8b07894e2ca3f2a4c3094065fa6e0a5)
�os�path�joinr�script�mkdirr�TESTFN_ASCII�fodder�open�write�
fodder_md5�fodder_textmode_md5)�cls�f�r�8/usr/local/lib/python3.10/test/test_tools/test_md5sum.py�
setUpClasss�
zMD5SumTests.setUpClasscCst�tj�dS)N)r�rmtreer)rrrr�
tearDownClassszMD5SumTests.tearDownClasscCs:t|j�\}}}|�|d�|�|�d��|�|�dS)Nrs(d41d8cd98f00b204e9800998ecf8427e <stdin>)rr�assertEqual�
assertTrue�
startswith�assertFalse��self�rc�out�errrrr�test_noargss�zMD5SumTests.test_noargscCsft|j|j�\}}}|�|d�|�|�|j��|j�tj	j
�D]
}|�|��|�q!|�
|�dS)Nr)rrrrrrr�splitrr�sep�assertIn�encoder )r"r#r$r%�partrrr�test_checksum_fodder%sz MD5SumTests.test_checksum_foddercCslt|jd|j�\}}}|�|d�|�|j|�|j�tjj	�}|�|d�
�|�|�|d�
�|�dS)Nz-lr������)rrrrr)rr'rrr(r*�assertNotIn)r"r#r$r%�partsrrr�test_dash_l-szMD5SumTests.test_dash_lcCsFt|jd|j�\}}}|�|d�|�|�|j��|�|j|�dS)Nz-tr)	rrrrrrrr/rr!rrr�test_dash_t5szMD5SumTests.test_dash_tcCs6t|jdd|j�\}}}|�|d�|�|j|�dS)Nz-sZ512r)rrrrr)rr!rrr�test_dash_s;szMD5SumTests.test_dash_scCsJt|j|j|j�\}}}|�|d�|��}|�t|�d�|j|�dS)Nr�)rrrr�
splitlines�len)r"r#r$r%�linesrrr�test_multiple_files@s
zMD5SumTests.test_multiple_filescCs:t|jd�\}}}|�|d�|�|d�|�|d�dS)Nz-hr4�)rrrZ
assertGreaterr!rrr�
test_usageGszMD5SumTests.test_usageN)
�__name__�
__module__�__qualname__�classmethodrrr&r,r1r2r3r8r:rrrrr	s
	
r	�__main__)�__doc__�sysrZunittestZtest.supportrrZtest.support.script_helperrrZtest.test_toolsrrZrequires_hashdigestZTestCaser	r;�mainrrrr�<module>s?�