Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.118.253.87
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_mailcap.cpython-310.pyc
o

ab(�@spddlZddlZddlZddlZddlmZddlZddlZej�	d�Z
dddddd	�gd
ddd
�gdddddd�gddd�gd
ddd�dddd�gddd�gddd
d d!d"�gd#d
d$d%d&�gd'd(d�gd)d*d�gd+d,d�gd-d.dd/�gd'd0d�gd1�
Ze�e�Z
e
��D]ZeD]Ze�d2�q�q�Gd3d4�d4ej�ZGd5d6�d6ej�ZGd7d8�d8ej�Zed9kr�e��dSdS):�N)�	os_helperzmailcap.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�)�
copiousoutputrr�audiocompose %s�"An audio fragment"�showaudio %s���editrrrr�mpeg_play %s�
�rrzps-to-terminal %s�)�
needsterminalrrzidraw %s�)rrrzxdvi %s��
extcompose %s�4"A reference to data stored in an external location"�Qshowexternal %s %{access-type} %{name} %{site}     %{directory} %{mode} %{server}�
�Zcomposetypedrrrrz?test "`echo     %{charset} | tr '[A-Z]' '[a-z]'`"  = iso-8859-8z)shownonascii iso-8859-8 -e richtext -p %s�)�testr
rrz
display %s�	�/usr/local/bin/showaudio %t��
animate %s�z
"cat %s | lp"zshowframe %s)�printrr�)
zapplication/x-moviez
application/*�audio/basic�
video/mpegzapplication/postscriptzapplication/x-dvi�message/external-bodyz
text/richtextzimage/x-xwindowdump�audio/*�video/*zapplication/framez	image/rgbrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�HelperFunctionTestcCs�t��}|�|t�|D]}|�|t�qt���%}d|vr'|d�tj	�}nddg}tj	�
|�|d<t��}Wd�n1sAwY|�||�dS)N�MAILCAPSz/testdir1/.mailcapz/testdir2/mailcap)�mailcap�listmailcapfiles�assertIsInstance�list�strr�EnvironmentVarGuard�split�os�pathsep�join�assertEqual)�selfZmcfiles�m�envZenv_mailcaps�r;�:/usr/local/python-3.10/lib/python3.10/test/test_mailcap.py�test_listmailcapfilesGs
��	z(HelperFunctionTest.test_listmailcapfilesc	Csnttd��"}|�t��
t�|�}Wd�n1swYWd�n1s*wY|�|t�dS)N�r)�open�MAILCAPFILEZassertWarns�DeprecationWarningr-Zreadmailcapfile�assertDictEqual�MAILCAPDICT_DEPRECATED)r8�mcf�dr;r;r<�test_readmailcapfileZs���z'HelperFunctionTest.test_readmailcapfilecCs�ddd�ddd�g}t�td�}|�||�d}ddd	d
dd�g}t�td
|�}|�||�ddiddig}t�td�}|�||�dS)Nr"r#rrrr'rrrr
rrr&r)r-�lookup�MAILCAPDICTZassertListEqualrC)r8Zexpected�actual�keyr;r;r<�test_lookupas"��zHelperFunctionTest.test_lookupc
Cs�gd�}gd�dfgd�dfgd�dfgd�d	fgd
�dfddd
|gdfddd
|gdfg}|D]}|�tj|d�|d�q/dS)N)zid=1znumber=2ztotal=3)rr)�foo.txtr)�echo foor)rLrM)zecho %sr)rLzecho foo.txt)�echo %tr)rLzecho audio/*)zecho \%tr)rLrNr)rLz
echo %{total}zecho 3rr)r7r-�subst)r8�plistZ
test_casesZtcr;r;r<�
test_substws




�	�zHelperFunctionTest.test_substN)�__name__�
__module__�__qualname__r=rFrKrQr;r;r;r<r+Es
r+c@seZdZdd�Zdd�ZdS)�GetcapsTestcCsJt���}t|d<t��}|�|t�Wd�dS1swYdS)Nr,)rr2r@r-�getcapsrBrH)r8r:�capsr;r;r<�test_mock_getcaps�s

"�zGetcapsTest.test_mock_getcapscCs�t��}|�|t�t��}dd�|D�}|r9|��D]\}}|�|t�|�|t�|D]}|�|t�q-qdS|�i|�dS)NcSsg|]
}tj�|�r|�qSr;)r4�path�exists)�.0rDr;r;r<�
<listcomp>�sz3GetcapsTest.test_system_mailcap.<locals>.<listcomp>)	r-rVr/�dictr.�itemsr1r0r7)r8rWZmailcapfilesZexistingmcfiles�k�v�er;r;r<�test_system_mailcap�s��zGetcapsTest.test_system_mailcapN)rRrSrTrXrbr;r;r;r<rU�s	rUc@sHeZdZdd�Ze�ejdkd�e�e	j
dkd�dd���Zd	d
�ZdS)�
FindmatchTestc	Cs2t}d}gd�}dddddd�}dd	d
�}ddd
�}d
ddddd�}idgidf|dgidf|dgid|ff|ddgid|ff|ddgid|ff|ddgid|ff|ddgidf|dgd|id||ff|ddgd|id||ff|dgd|d�d|ff|d gd|id!|ff|d"gd#|id$|ffg}|�|�dS)%NrL)zaccess-type=defaultz	name=johnzsite=python.orgzdirectory=/tmpzmode=fooz
server=barrrr
rrr r!rr"r#rrrrrrr'�NNzfoo/barzanimate /dev/nullr&rzaudiocompose /dev/nullrrZfoobarr*�filename)rJrer)z /usr/local/bin/showaudio audio/*r(rPz?showexternal /dev/null default john python.org     /tmp foo bar)rH�
_run_cases)	r8�cZfnamerPZaudio_basic_entryZaudio_entryZvideo_entryZ
message_entry�casesr;r;r<�test_findmatch�sT�

�
�����zFindmatchTest.test_findmatch�posixz!Requires 'test' command on system�vxworksz*'test' command is not supported on VxWorkscCsLddigddigd�}|ddgidddiff|ddgidfg}|�|�dS)Nrztest 1 -eq 1ztest 1 -eq 0)�	test/pass�	test/failrlrmrd)rf)r8rWrhr;r;r<�	test_test�s��zFindmatchTest.test_testcCs2|D]}|�tj|di|d��|d�qdS)Nrrr)r7r-Z	findmatch)r8rhrgr;r;r<rf�s&�zFindmatchTest._run_casesN)
rRrSrTri�unittestZ
skipUnlessr4�nameZskipIf�sys�platformrnrfr;r;r;r<rc�s3rc�__main__)r-r4�copyZtest.supportrrrorq�supportZfindfiler@rH�deepcopyrC�valuesZ
entry_list�entry�popZTestCaser+rUrcrR�mainr;r;r;r<�<module>sr���


�
��



�
1�BM�
© 2025 GrazzMean