Your IP : 216.73.216.103


Current Path : /lib64/python2.7/test/
Upload Files:
Current File: //lib64/python2.7/test/test_mailcap.pyc

�
zfc@s�ddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlZejjd�Z
i
idd6dd6d	d
6dd6d
d6gd6idd6dd6dd6gd6idd6dd6dd
6dd6dd6gd6idd6dd6gd6idd6dd6d d6id!d6dd6d"d6gd#6id$d6d%d6gd&6id'd(6d)d
6dd6d*d6d+d6gd,6id-d.6dd6d/d6d0d6gd16id2d6d3d6gd46id5d6d6d6gd76id8d6d9d6gd:6id;d<6d=d6d>d6gd?6id2d6d@d6gdA6ZeZx2ej�D]$ZxeD]Zejd�qbWqUWdBejfdC��YZdDejfdE��YZdFejfdG��YZdH�ZdS(Ii����N(tsupport(tOrderedDictsmailcap.txts
moviemaker %stcomposes""/usr/lib/Zmail/bitmaps/movie.xbm"s
x11-bitmaps"Movie"tdescriptionsmovieplayer %stviewitlinenosapplication/x-moviett
copiousoutputs?echo "This is \"%t\" but        is 50 \% Greek to me" \; cat %sis
application/*saudiocompose %stedits"An audio fragment"sshowaudio %sisaudio/basicsmpeg_play %si
s
video/mpegt
needsterminalsps-to-terminal %sisidraw %sisapplication/postscriptsxdvi %sisapplication/x-dvis
extcompose %stcomposetypeds4"A reference to data stored in an external location"sQshowexternal %s %{access-type} %{name} %{site}     %{directory} %{mode} %{server}i
smessage/external-bodys?test "`echo     %{charset} | tr '[A-Z]' '[a-z]'`"  = iso-8859-8ttests)shownonascii iso-8859-8 -e richtext -p %sis
text/richtexts
display %si	simage/x-xwindowdumps/usr/local/bin/showaudio %tisaudio/*s
animate %sisvideo/*s
"cat %s | lp"tprintsshowframe %sisapplication/frameis	image/rgbtHelperFunctionTestcBs,eZd�Zd�Zd�Zd�ZRS(cCs�tj�}|j|t�x|D]}|j|t�q#Wtj��Z}d|krq|djtj	�}n.ddg}tj	j
|�|d<tj�}WdQX|j||�dS(NtMAILCAPSs/testdir1/.mailcaps/testdir2/mailcap(tmailcaptlistmailcapfilestassertIsInstancetlisttstrt	os_helpertEnvironmentVarGuardtsplittostpathseptjointassertEqual(tselftmcfilestmtenvtenv_mailcaps((s)/usr/lib64/python2.7/test/test_mailcap.pyttest_listmailcapfilesNs
cCs;ttd��}tj|�}WdQX|j|t�dS(Ntr(topentMAILCAPFILERtreadmailcapfiletassertDictEqualtMAILCAPDICT_DEPRECATED(Rtmcftd((s)/usr/lib64/python2.7/test/test_mailcap.pyttest_readmailcapfileascCs�idd6idd6g}tjtd�}|j||�d}idd6dd6dd	6d
d6g}tjtd|�}|j||�idd6idd6g}tjtd�}|j||�dS(Nsmpeg_play %sRs
animate %ss
video/mpegRsaudiocompose %sRs"An audio fragment"Rsshowaudio %ssaudio/basic(RtlookuptMAILCAPDICTtassertListEqualR&(Rtexpectedtactualtkey((s)/usr/lib64/python2.7/test/test_mailcap.pyttest_lookupgs


cCs�dddg}dddgdfdddgdfdddgd	fd
ddgdfd
ddgdfd
ddgd
fddd|gdfddd|gdfg}x/|D]'}|jtj|d�|d�q�WdS(Nsid=1snumber=2stotal=3Rsaudio/*sfoo.txtsecho foosecho %ssecho foo.txtsecho %ts	audio/wavsecho audio/wavsecho \%ts
echo %{total}secho 3ii(tNoneRRtsubst(Rtplistt
test_casesttc((s)/usr/lib64/python2.7/test/test_mailcap.pyt
test_subst�s
(t__name__t
__module__R R)R0R6(((s)/usr/lib64/python2.7/test/test_mailcap.pyR
Ls			tGetcapsTestcBseZd�Zd�ZRS(cCs?tj��-}t|d<tj�}|j|t�WdQXdS(NR(RRR#RtgetcapsR%R+(RRtcaps((s)/usr/lib64/python2.7/test/test_mailcap.pyttest_mock_getcaps�s
cCs�tj�}|j|t�tj�}g|D]}tjj|�r/|^q/}|r�xn|j�D]M\}}|j|t	�|j|t
�x|D]}|j|t�q�WqfWn|ji|�dS(N(RR:RtdictRRtpathtexiststitemsRRR(RR;tmailcapfilesR'texistingmcfilestktvte((s)/usr/lib64/python2.7/test/test_mailcap.pyttest_system_mailcap�s+
(R7R8R<RF(((s)/usr/lib64/python2.7/test/test_mailcap.pyR9�s		t
FindmatchTestcBsYeZd�Zejejdkd�ejej	dkd�d���Z
d�ZRS(c
Cst}d}ddddddg}idd	6dd
6dd6d
d6}idd6}idd6}idd6}idd6dd6dd6dd6}idgid'f|dgid(f|dgid|ff|dd	gid|ff|dd
gid|ff|ddgid|ff|ddgid)f|dgi|d6d||ff|dd
gi|d6d||ff|dgidd 6|d6d|ff|d!gi|d6d*f|d"gi|d6d#|ff|d$gi|d%6d&|ffg
}	|j|	�dS(+Nsfoo.txtsaccess-type=defaults	name=johnssite=python.orgsdirectory=/tmpsmode=foos
server=barsaudiocompose %sRRs"An audio fragment"Rsshowaudio %sRs/usr/local/bin/showaudio %ts
animate %ssmpeg_play %ss
extcompose %sR
s4"A reference to data stored in an external location"RR	sQshowexternal %s %{access-type} %{name} %{site}     %{directory} %{mode} %{server}s
video/mpegsfoo/barsmpeg_play /dev/nullsaudio/basicsaudiocompose /dev/nulltfoobarsvideo/*tfilenameR/saudio/*s	audio/wavs"/usr/local/bin/showaudio audio/wavsmessage/external-bodyR3s?showexternal /dev/null default john python.org     /tmp foo bar(NN(NN(NN(NN(R+R1t
_run_cases(
RtctfnameR3taudio_basic_entrytaudio_entrytvideo_entryt
mpeg_entryt
message_entrytcases((s)/usr/lib64/python2.7/test/test_mailcap.pyttest_findmatch�sP	




#
		
	
	
tposixs!Requires 'test' command on systemtvxworkss*'test' command is not supported on VxWorkscCsviidd6gd6idd6gd6}|ddgididd6ff|ddgidfg}|j|�dS(Nstest 1 -eq 1Rs	test/passstest 1 -eq 0s	test/fail(NN(R1RJ(RR;RR((s)/usr/lib64/python2.7/test/test_mailcap.pyt	test_test�s
"cCs=x6|D].}|jtj|d|d�|d�qWdS(Niii(RRt	findmatch(RRRRK((s)/usr/lib64/python2.7/test/test_mailcap.pyRJ�s
(R7R8RStunittestt
skipUnlessRtnametskipIftsystplatformRVRJ(((s)/usr/lib64/python2.7/test/test_mailcap.pyRG�s	:'cCstjjttt�dS(N(RRtrun_unittestR
R9RG(((s)/usr/lib64/python2.7/test/test_mailcap.pyt	test_mains(tcopyRR\ttest.supportRRXRRtwarnings_helpertcollectionsRRtfindfileR#R+R&tvaluest
entry_listtentrytpoptTestCaseR
R9RGR_(((s)/usr/lib64/python2.7/test/test_mailcap.pyt<module>sb





ET