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.7/test/__pycache__/test_mailcap.cpython-37.opt-1.pyc
B

��g�'�@sdddlZddlZddlZddlZddlZej�d�Zdddddd�gd	d
dd�gd
d
dddd�gddd�gd	ddd�dddd�gddd�gddd	dd d!�gd"d	d#d$d%�gd&d'd�gd(d)d�gd*d+d�gd,d-dd.�gd&d/d�gd0�
Z	e�
e	�Zx*e��D]Z
xe
D]Ze�d1��qWq�WGd2d3�d3ej�ZGd4d5�d5ej�ZGd6d7�d7ej�Zed8k�r`e��dS)9�Nzmailcap.txtz
moviemaker %sz""/usr/lib/Zmail/bitmaps/movie.xbm"z"Movie"zmovieplayer %s�)�composez
x11-bitmap�description�view�lineno�z?echo "This is \"%t\" but        is 50 \% Greek to me" \; cat %s�)�
copiousoutputrrzaudiocompose %sz"An audio fragment"zshowaudio %s�)�editrrrrzmpeg_play %s�
)rrzps-to-terminal %s�)�
needsterminalrrzidraw %s�)rrrzxdvi %s�z
extcompose %sz4"A reference to data stored in an external location"zQshowexternal %s %{access-type} %{name} %{site}     %{directory} %{mode} %{server}�
)�composetypedrrrrz?test "`echo     %{charset} | tr '[A-Z]' '[a-z]'`"  = iso-8859-8z)shownonascii iso-8859-8 -e richtext -p %s�)�testr	rrz
display %s�	z/usr/local/bin/showaudio %t�z
animate %s�z
"cat %s | lp"zshowframe %s)�printrr�)
zapplication/x-moviez
application/*zaudio/basicz
video/mpegzapplication/postscriptzapplication/x-dvizmessage/external-bodyz
text/richtextzimage/x-xwindowdumpzaudio/*zvideo/*zapplication/framez	image/rgbrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�HelperFunctionTestc	Cs�t��}|�|t�x|D]}|�|t�qWtj���@}d|krT|d�t	j
�}n ddg}t	j
�|�|d<t��}WdQRX|�||�dS)N�MAILCAPSz/testdir1/.mailcapz/testdir2/mailcap)
�mailcap�listmailcapfiles�assertIsInstance�list�strr�support�EnvironmentVarGuard�split�os�pathsep�join�assertEqual)�selfZmcfiles�m�envZenv_mailcaps�r+�-/usr/local/lib/python3.7/test/test_mailcap.py�test_listmailcapfilesEs
z(HelperFunctionTest.test_listmailcapfilesc
CsFttd��&}|�t��t�|�}WdQRXWdQRX|�|t�dS)N�r)�open�MAILCAPFILEZassertWarns�DeprecationWarningrZreadmailcapfile�assertDictEqual�MAILCAPDICT_DEPRECATED)r(�mcf�dr+r+r,�test_readmailcapfileXsz'HelperFunctionTest.test_readmailcapfilecCs�ddd�ddd�g}t�td�}|�||�d}ddd	d
dd�g}t�td
|�}|�||�ddiddig}t�td�}|�||�dS)Nz
animate %sr)rrzmpeg_play %srz
video/mpegrzaudiocompose %sz"An audio fragment"zshowaudio %sr
)rrrrrzaudio/basicr)r�lookup�MAILCAPDICTZassertListEqualr3)r(Zexpected�actual�keyr+r+r,�test_lookup_s
zHelperFunctionTest.test_lookupc
Cs�dddg}dddgdfdddgdfdddgd	fd
ddgdfdddgd
fddd|gdfd
dd|gdfg}x&|D]}|�tj|d�|d�qlWdS)Nzid=1znumber=2ztotal=3rzaudio/*zfoo.txtzecho foozecho %szecho foo.txtzecho %tzecho audio/*zecho \%tz
echo %{total}zecho 3rr
)r'rZsubst)r(�plistZ
test_casesZtcr+r+r,�
test_substus

zHelperFunctionTest.test_substN)�__name__�
__module__�__qualname__r-r6r;r=r+r+r+r,rCsrc@seZdZdd�Zdd�ZdS)�GetcapsTestc	Cs6tj���"}t|d<t��}|�|t�WdQRXdS)Nr)rr!r"r0r�getcapsr2r8)r(r*�capsr+r+r,�test_mock_getcaps�szGetcapsTest.test_mock_getcapscCs�t��}|�|t�t��}dd�|D�}|rxxT|��D]:\}}|�|t�|�|t�x|D]}|�|t�q^Wq8Wn|�i|�dS)NcSsg|]}tj�|�r|�qSr+)r$�path�exists)�.0r4r+r+r,�
<listcomp>�sz3GetcapsTest.test_system_mailcap.<locals>.<listcomp>)	rrBr�dictr�itemsr rr')r(rCZmailcapfilesZexistingmcfiles�k�v�er+r+r,�test_system_mailcap�s
zGetcapsTest.test_system_mailcapN)r>r?r@rDrNr+r+r+r,rA�s	rAc@s6eZdZdd�Ze�ejdkd�dd��Zdd�Z	d	S)
�
FindmatchTestc	Cs:t}d}ddddddg}ddd	d
dd�}d
dd�}ddd�}dddddd�}idgidf|dgidf|dgid|ff|ddgid|ff|ddgid|ff|dd gid	|ff|dd!gidf|d"gd#|id||ff|ddgd#|id||ff|dgd |d$�d	|ff|d%gd#|id&|ff|d'gd(|id)|ffg}|�|�dS)*Nzfoo.txtzaccess-type=defaultz	name=johnzsite=python.orgzdirectory=/tmpzmode=fooz
server=barzaudiocompose %sz"An audio fragment"zshowaudio %sr
)rrrrrz/usr/local/bin/showaudio %tr)rrz
animate %srz
extcompose %sz4"A reference to data stored in an external location"rzQshowexternal %s %{access-type} %{name} %{site}     %{directory} %{mode} %{server}r)rrrrrz
video/mpeg)NNzfoo/barzanimate /dev/nullzaudio/basicrzaudiocompose /dev/nullrrZfoobarzvideo/*�filename)r:rPzaudio/*z /usr/local/bin/showaudio audio/*zmessage/external-bodyr<z?showexternal /dev/null default john python.org     /tmp foo bar)r8�
_run_cases)	r(�cZfnamer<Zaudio_basic_entryZaudio_entryZvideo_entryZ
message_entry�casesr+r+r,�test_findmatch�sH


zFindmatchTest.test_findmatch�posixz!Requires 'test' command on systemcCsLddigddigd�}|ddgidddiff|ddgidfg}|�|�dS)Nrztest 1 -eq 1ztest 1 -eq 0)z	test/passz	test/failz	test/passz	test/fail)NN)rQ)r(rCrSr+r+r,�	test_test�s
zFindmatchTest.test_testcCs2x,|D]$}|�tj|d|d�|d�qWdS)Nrr
r)r'rZ	findmatch)r(rSrRr+r+r,rQ�s
zFindmatchTest._run_casesN)
r>r?r@rT�unittestZ
skipUnlessr$�namerVrQr+r+r+r,rO�s3rO�__main__)rr$�copyZtest.supportrrWr!Zfindfiler0r8Zdeepcopyr3�valuesZ
entry_list�entry�popZTestCaserrArOr>�mainr+r+r+r,�<module>sZ







BL