Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_mailcap.cpython-312.opt-2.pyc

�

'Μg�-��v�ddlZddlZddlZddlZddlZddlmZddlmZejd�Z	ejjd�Zdddd	d
d�gdd
dd�gdddddd�gddd�gdddd�dddd�gddd�gd d!dd"d#d$�gd%dd&d'd(�gd)d*d�gd+d,d�gd-d.d�gd/d0dd1�gd)d2d�gd3�
Z
eje
�Zej!�D]ZeD]Zej'd4���Gd5�d6ej(�ZGd7�d8ej(�ZGd9�d:ej(�Zed;k(rej2�yy)<�N)�	os_helper)�warnings_helper�mailcapzmailcap.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�)�
copiousoutputr	r
�audiocompose %s�"An audio fragment"�showaudio %s���editrrr	r
�mpeg_play %s�
�r	r
zps-to-terminal %s�)�
needsterminalr	r
zidraw %s�)rr	r
zxdvi %s��
extcompose %s�4"A reference to data stored in an external location"�Qshowexternal %s %{access-type} %{name} %{site}     %{directory} %{mode} %{server}�
��composetypedrrr	r
z?test "`echo     %{charset} | tr '[A-Z]' '[a-z]'`"  = iso-8859-8z)shownonascii iso-8859-8 -e richtext -p %s�)�testr
r	r
z
display %s�	�/usr/local/bin/showaudio %t��
animate %s�z
"cat %s | lp"zshowframe %s)�printr	r
�)
zapplication/x-moviez
application/*�audio/basic�
video/mpegzapplication/postscriptzapplication/x-dvi�message/external-bodyz
text/richtextzimage/x-xwindowdump�audio/*�video/*zapplication/framez	image/rgbr
c�$�eZdZd�Zd�Zd�Zd�Zy)�HelperFunctionTestc���tj�}|j|t�|D]}|j|t��tj�5}d|vr#|djtj�}n:ddg}tjj|�|d<tj�}ddd�|j|�y#1swY�xYw)N�MAILCAPSz/testdir1/.mailcapz/testdir2/mailcap)r�listmailcapfiles�assertIsInstance�list�strr�EnvironmentVarGuard�split�os�pathsep�join�assertEqual)�self�mcfiles�m�env�env_mailcapss     �./usr/local/lib/python3.12/test/test_mailcap.py�test_listmailcapfilesz(HelperFunctionTest.test_listmailcapfilesKs����*�*�,�����g�t�,��A��!�!�!�S�)��
�
*�
*�
,���S� �"�:��4�4�R�Z�Z�@�� 4�6I�J��"$�*�*�/�/�,�"?��J��!�2�2�4��-�	
����w�/�-�
,�s
�A"C�C"c��ttd�5}|jt�5tj|�}ddd�ddd�|j
t�y#1swY�(xYw#1swY�,xYw)N�r)�open�MAILCAPFILE�assertWarns�DeprecationWarningr�readmailcapfile�assertDictEqual�MAILCAPDICT_DEPRECATED)r=�mcf�ds   rB�test_readmailcapfilez'HelperFunctionTest.test_readmailcapfile^s\��
�+�s�
#�s��!�!�"4�5��+�+�C�0��6�$�	
���Q� 6�7�6�5��$�
#�s!�A0�A$�A0�$A-	�)A0�0A9c�H�ddd�ddd�g}tjtd�}|j||�d}ddd	d
dd�g}tjtd
|�}|j||�ddiddig}tjtd�}|j||�y)Nr&r'rrrr+rrrrrrr*r	)r�lookup�MAILCAPDICT�assertListEqualrL)r=�expected�actual�keys    rB�test_lookupzHelperFunctionTest.test_lookupes���)�R�8�+�r�:�<������\�:�����X�v�.���.� 1�$9�+� �	"�#��
����]�C�@�����X�v�.��^�,�v�|�.D�E����� 6��E�����X�v�.�c
��gd�}gd�dfgd�dfgd�dfgd�d	fgd
�dfddd
|gdfddd
|gdfg}|D]*}|jtj|d�|d��,y)N)zid=1znumber=2ztotal=3)rr-�foo.txtr)�echo foor-rZr[)zecho %sr-rZzecho foo.txt)�echo %t�	audio/wavrZzecho audio/wav)zecho \%tr-rZr\r-rZ�
echo %{total}zecho 3rr)r<r�subst)r=�plist�
test_cases�tcs    rB�
test_substzHelperFunctionTest.test_subst{s���/��(��,�
/��<�
.��?�
0�2B�C�
0�)�<��)�Y��
6�
�C��y�)�U�
;�X�F�
�
��B����W�]�]�B�q�E�2�B�q�E�:�rXN)�__name__�
__module__�__qualname__rCrOrWrc�rXrBr0r0Is��0�&8�/�,
;rXr0c��eZdZd�Zd�Zy)�GetcapsTestc��tj�5}t|d<tj	�}|j|t�ddd�y#1swYyxYw)Nr2)rr7rGr�getcapsrKrR)r=r@�capss   rB�test_mock_getcapszGetcapsTest.test_mock_getcaps�sC���
*�
*�
,��)�C�
�O��?�?�$�D�� � ��{�3�-�
,�
,�s�4A�Ac���tj�}|j|t�tj	�}|D�cgc]$}t
jj|�s�#|��&}}|rb|j�D]N\}}|j|t�|j|t�|D]}|j|t���Py|ji|�ycc}w)N)rrkr4�dictr3r9�path�exists�itemsr6r5r<)r=rl�mailcapfilesrM�existingmcfiles�k�v�es        rB�test_system_mailcapzGetcapsTest.test_system_mailcap�s������ �����d�D�)��/�/�1��*6�N�,�3�"�'�'�.�.��:M�3�,��N���*�*�,���A��%�%�a��-��%�%�a��.��A��)�)�!�T�2��'�
���R��&��Os�$C%�(C%N)rdrerfrmrxrgrXrBriri�s��4�'rXric��eZdZd�Zej
ejdk(d�eje	jdk(d�ej
ejjd�d����Zd�Zd	�Zy
)�
FindmatchTestc�V�t}d}gd�}dddddd�}dd	d
�}ddd
�}d
ddddd�}idgidf|dgidf|dgid|ff|ddgid|ff|ddgid|ff|ddgid|ff|ddgidf|dgd|id|z|ff|ddgd|id|z|ff|dgd|d�d|ff|d gd|id!|ff|d"gd#|id$|ffg}|j|�y)%NrZ)zaccess-type=defaultz	name=johnzsite=python.orgzdirectory=/tmpzmode=fooz
server=barrrrrrr$r%rr&r'rrrrrrr+�NNzfoo/barzanimate /dev/nullr*rzaudiocompose /dev/nullrr�foobarr.�filename)rVr~r]z"/usr/local/bin/showaudio audio/wavr,r`z?showexternal /dev/null default john python.org     /tmp foo bar)rR�
_run_cases)	r=�c�fnamer`�audio_basic_entry�audio_entry�video_entry�
message_entry�casess	         rB�test_findmatchzFindmatchTest.test_findmatch�s���
����=��&�(�0�"��
�� =��J��+�r�:��+�Q�df�g��	
�
��,�
��\�2���^�R��.���
��%8�+�$F�G����
'��.F�HY�-Z�[���	�
*�B�1I�K\�0]�^���
�
.��5J�L]�4^�_����
)�2�|�<���^�j�%�0�<�%�3G��2U�V���	�
*��%�
 ��%�'�):�
;�
=���
�"��
6�#�%6�
7�
9���
��%�
 �2�K�
@�
B��(�
)��u�
�O�Q^�
_�
a�%
��,	
����rX�posixz!Requires 'test' command on system�vxworksz*'test' command is not supported on VxWorksz%'test' command needs process support.c�d�ddigddigd�}|ddgidddiff|ddgidfg}|j|�y)Nr"ztest 1 -eq 1ztest 1 -eq 0)�	test/pass�	test/failr�r�r|)r)r=rlr�s   rB�	test_testzFindmatchTest.test_test�sd�� &�~�6�7�%�~�6�7�9���K��
(�"�~���?W�.X�Y��K��
(�"�l�;�	
��	
����rXc�F�|jtjd�5tjddddg�}|j	|d�ddd�|jtjd�5tjddd�}|j	|d�ddd�|jtjd	�5tjtdd
��}|j	|d�ddd�y#1swY��xYw#1swY�mxYw#1swYyxYw)
Nz6Refusing to substitute parameter.*into a shell commandr^r]rZztotal=*z.Refusing to substitute MIME type.*into a shellr\r-zERefusing to use mailcap with filename.*Use a safe temporary filename.zfoo*.txt)r~r|)�assertWarnsRegexr�UnsafeMailcapInputr_r<�	findmatchrR)r=�unsafe_param�unsafe_mimetype�unsafe_filenames    rB�test_unsafe_mailcap_inputz'FindmatchTest.test_unsafe_mailcap_input�s��
�
"�
"�7�#=�#=�$:�;�#�=�=��)4�)2�*3��6�L�
���\�4�0�;��
"�
"�7�#=�#=�$4�5�&�m�m�I�y�)�L�O����_�d�3�	5��
"�
"�7�#=�#=�$D�E�&�/�/��0;�9C�0�E�O�
���_�l�;�
E�E�;�;��5�5��E�E�s#�,C?�5*D�/D�?D�D�D c	�n�|D]0}|jtj|di|d��|d��2y)Nrrr)r<rr�)r=r�r�s   rBrzFindmatchTest._run_casess8���A����W�.�.��!��=��!��=�q��t�D�rXN)rdrerfr��unittest�
skipUnlessr9�name�skipIf�sys�platformr"�support�has_subprocess_supportr�r�rrgrXrBrzrz�s���1�f�X������G�+�-P�Q��X�_�_�S�\�\�Y�.�0\�]��X������+�+�/���	�^�R��"<�0ErXrz�__main__)�copyr9r��test.supportr"r�rr�import_deprecatedrr��findfilerGrR�deepcopyrL�values�
entry_list�entry�pop�TestCaser0rirzrd�mainrgrXrB�<module>r�s����	�
���"�(�,�/�
+�
+�I�
6���l�l�#�#�M�2��%�<�"�"��	
�	��W��
�	�$�&�.� ��	
�	�!�B�	/�0��':�a�	H��)<��	J�	L��q�	)�*�)�O��e��	
�	�X��=��
�	�
�!�	,�-�/�1�	=�>��"�	-�.�"�N�a�	H�I��!�	,�-�Y-��b'����{�3��(�/�/�1�J���
�	�	�(���2�
?;��*�*�?;�D'�(�#�#�'�:fE�H�%�%�fE�R�z���H�M�M�O�rX

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