Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_mailcap.cpython-39.opt-1.pyc

a

��g(�@sZddlZddlZddlZddlZddlZej�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	�Ze��D]Z
e
D]Ze�d1�q�q�Gd2d3�d3ej�ZGd4d5�d5ej�ZGd6d7�d7ej�Zed8k�rVe��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�)�
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�qtj���J}d|vrP|d�t	j
�}n ddg}t	j
�|�|d<t��}Wd�n1s�0Y|�||�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.9/test/test_mailcap.py�test_listmailcapfilesEs&z(HelperFunctionTest.test_listmailcapfilesc	Csnttd��D}|�t��t�|�}Wd�n1s60YWd�n1sT0Y|�|t�dS)N�r)�open�MAILCAPFILEZassertWarns�DeprecationWarningr,Zreadmailcapfile�assertDictEqual�MAILCAPDICT_DEPRECATED)r8�mcf�dr;r;r<�test_readmailcapfileXsFz'HelperFunctionTest.test_readmailcapfilecCs�ddd�ddd�g}t�td�}|�||�d}ddd	d
dd�g}t�td
|�}|�||�ddiddig}t�td�}|�||�dS)Nr!r"rrrr&rr
rrr
rr%r)r,�lookup�MAILCAPDICTZassertListEqualrC)r8Zexpected�actual�keyr;r;r<�test_lookup_s"��zHelperFunctionTest.test_lookupcCs�gd�}gd�dfgd�dfgd�dfgd�dfgd	�d
fgd�dfdd
d|gdfdd
d|gdfg}|D]}|�tj|d�|d�qhdS)N)zid=1znumber=2ztotal=3)rr(�foo.txtr)�echo foor(rLrM)zecho %sr(rLzecho foo.txt)�echo %tr(rL)rN�	audio/wavrLzecho audio/wav)zecho \%tr(rLrNr(rLz
echo %{total}zecho 3rr)r7r,�subst)r8�plistZ
test_casesZtcr;r;r<�
test_substus





�
zHelperFunctionTest.test_substN)�__name__�
__module__�__qualname__r=rFrKrRr;r;r;r<r*Csr*c@seZdZdd�Zdd�ZdS)�GetcapsTestcCsJtj���,}t|d<t��}|�|t�Wd�n1s<0YdS)Nr+)rr1r2r@r,�getcapsrBrH)r8r:�capsr;r;r<�test_mock_getcaps�szGetcapsTest.test_mock_getcapscCs�t��}|�|t�t��}dd�|D�}|rp|��D]6\}}|�|t�|�|t�|D]}|�|t�qZq6n|�i|�dS)NcSsg|]}tj�|�r|�qSr;)r4�path�exists)�.0rDr;r;r<�
<listcomp>��z3GetcapsTest.test_system_mailcap.<locals>.<listcomp>)	r,rWr.�dictr-�itemsr0r/r7)r8rXZmailcapfilesZexistingmcfiles�k�v�er;r;r<�test_system_mailcap�szGetcapsTest.test_system_mailcapN)rSrTrUrYrdr;r;r;r<rV�s	rVc@s6eZdZdd�Ze�ejdkd�dd��Zdd�Z	d	S)
�
FindmatchTestc	CsBt}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|idf|d!gd|id"|ff|d#gd$|id%|ffg
}|�|�dS)&NrL)zaccess-type=defaultz	name=johnzsite=python.orgzdirectory=/tmpzmode=fooz
server=barr
rrr
rrr rr!r"rrrrrrr&�NNzfoo/barzanimate /dev/nullr%rzaudiocompose /dev/nullrrZfoobarr)�filename)rJrgr(rOz"/usr/local/bin/showaudio audio/wavr'rQz?showexternal /dev/null default john python.org     /tmp foo bar)rH�
_run_cases)	r8�cZfnamerQZaudio_basic_entryZaudio_entryZvideo_entryZ
message_entry�casesr;r;r<�test_findmatch�s\�

�
������zFindmatchTest.test_findmatch�posixz!Requires 'test' command on systemcCsLddigddigd�}|ddgidddiff|ddgidfg}|�|�dS)Nrztest 1 -eq 1ztest 1 -eq 0)�	test/pass�	test/failrmrnrf)rh)r8rXrjr;r;r<�	test_test�s��zFindmatchTest.test_testcCs2|D](}|�tj|di|d��|d�qdS)Nrrr)r7r,Z	findmatch)r8rjrir;r;r<rh�szFindmatchTest._run_casesN)
rSrTrUrk�unittestZ
skipUnlessr4�namerorhr;r;r;r<re�s6
re�__main__)r,r4�copyZtest.supportrrpr1Zfindfiler@rH�deepcopyrC�valuesZ
entry_list�entry�popZTestCaser*rVrerS�mainr;r;r;r<�<module>sh���


�
��



�1
CO


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists