%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/plesk/python/2.7/lib64/python2.7/test/
Upload File :
Create Path :
Current File : //proc/self/root/opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyo

�
5}�ac@sfddlZddlmZddlZddlZddlZddlZddlZyddlZWne	k
r�dZnXejje
�Zejjed�Zejdde�Zd�Zdejfd��YZd	ejfd
��YZdejfd��YZejedkd
�dejfd��Y�Zd�Zedkrbe�ndS(i����N(ttest_supportsselfsigned_pythontestdotnet.pemt	mimetoolst
deprecatedcOsWxJtd�D]<}y||||�SWq
tk
r?}q
q
�q
Xq
W|�dS(Ni(trangetIOError(tfuncthosttargstkwargstitlast_exc((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyt_open_with_retrystURLTimeoutTestcBs)eZdZd�Zd�Zd�ZRS(g$@cCstj|j�dS(N(tsockettsetdefaulttimeouttTIMEOUT(tself((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pytsetUp'scCstjd�dS(N(R
RtNone(R((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttearDown*scCs%ttjtj�}|j�}dS(N(RturllibturlopenRt
TEST_HTTP_URLtread(Rtftx((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttestURLread-s(t__name__t
__module__RRRR(((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyR#s		turlopenNetworkTestscBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Ze	j
ejd
kd�e	j
eed	�d
�d���Zd�ZRS(s6Tests urllib.urlopen using the network.

    These tests are not exhaustive.  Assuming that testing using files does a
    good job overall of some of the basic interface features.  There are no
    tests exercising the optional 'data' and 'proxies' arguments.  No tests
    for transparent redirection have been written.

    setUp is not used for always constructing a connection to
    http://www.example.com/ since there a few tests that don't use that address
    and making a connection is expensive enough to warrant minimizing unneeded
    connections.

    cGsttj|�S(N(RRR(RR((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyR@scCsl|jtj�}x+d
D]#}|jt||�d|�qWz|j|j�d	�Wd|j�XdS(NRtreadlinet	readlinestfilenotclosetinfotgeturls3object returned from urlopen lacks the %s attributescalling 'read' failed(RRRR R!R"R#(RRRt
assertTruethasattrRR!(Rtopen_urltattr((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyt
test_basicCs
cCsZ|jtj�}z6|j|j�td�|j|j�td�Wd|j�XdS(Ns readline did not return a stringsreadlines did not return a list(	RRRtassertIsInstanceRt
basestringRtlistR!(RR&((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_readlinesOscCs`|jtj�}z|j�}Wd|j�|j|tjd�|j|j	�d�XdS(NsAobject returned by 'info' is not an instance of mimetools.Messagethtml(
RRRR"R!R)RtMessagetassertEqualt
getsubtype(RR&tinfo_obj((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyt	test_infoZs
cCsG|jtj�}z|j�}Wd|j�X|j|tj�dS(N(RRRR#R!R/(RR&t
gotten_url((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_geturlfs
cCsMd}tj�j|�}z|j�}Wd|j�X|j|d�dS(Ns'http://www.pythontest.net/XXXinvalidXXXi�(RtFancyURLopenertopentgetcodeR!R/(RtURLR&tcode((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_getcodeostwin32snot appropriate for Windowstfdopensos.fdopen not availablecCsY|jtj�}|j�}tj|�}z|j|j�d�Wd|j�XdS(Ns<reading from file created using fd returned by fileno failed(	RRRR tosR<R$RR!(RR&tfdtFILE((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_filenoyscCsYd}ytj|�Wntjk
r-nX|jd|�|jttjd�dS(Nssadflkjsasf.i.nvali.ds&%r should not resolve for test to workshttp://sadflkjsasf.i.nvali.d/(R
t
gethostbynametgaierrortskipTesttassertRaisesRRR(Rtbogus_domain((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_bad_address�s	(R;(RRt__doc__RR(R,R2R4R:tunittesttskipIftsystplatformt
skipUnlessR%R=R@RF(((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyR1s
							
'
turlretrieveNetworkTestscBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s+Tests urllib.urlretrieve using the network.cGsttj|�S(N(RRturlretrieve(RR((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyRN�scCsy|jtj�\}}|jtjj|�d�t|�}z|j|j�d�Wd|j	�tj
|�XdS(Ns9file location returned by urlretrieve is not a valid paths=reading from the file location returned by urlretrieve failed(RNRRR$R=tpathtexiststfileRR!tunlink(Rt
file_locationR"R?((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyR(�s
cCs�|jtjtj�\}}|j|tj�|jtjj|��t	|�}z|j|j
�d�Wd|j�tj|�XdS(Ns"reading from temporary file failed(
RNRRtTESTFNR/R$R=RORPRQRR!RR(RRSR"R?((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_specified_path�s
cCs?|jtj�\}}tj|�|j|tjd�dS(Ns.header is not an instance of mimetools.Message(RNRRR=RRR)RR.(RRStheader((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_header�s
cCs|tj}|j|�\}}tj|�|jd�}d}ytj||�Wn!tk
rw|j	d|�nXdS(NtDates%a, %d %b %Y %H:%M:%S GMTsDate value not in %r format(
RRRNR=RRt	getheaderttimetstrptimet
ValueErrortfail(RtlogoRStfileheaderst	datevaluet
dateformat((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_data_header�s	

(RRRGRNR(RURWRb(((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyRM�s		
	
	srequires sslturlopen_HttpsTestscBseZd�ZRS(cCsAtjdt�}tjdd|�}|jd|j��dS(Ntcafiles"https://self-signed.pythontest.nettcontexttPython(tssltcreate_default_contextt CERT_selfsigned_pythontestdotnetRRtassertInR(RRetresponse((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyttest_context_argument�s(RRRl(((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyRc�sc	CsCtjd�tjdtf��tjtttt�WdQXdS(Ntnetworks!urllib.urlopen.. has been removed(	Rtrequirestcheck_py3k_warningstDeprecationWarningtrun_unittestRRRMRc(((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyt	test_main�s
	t__main__(RHttestRR
RRJR=RZRgtImportErrorRROtdirnamet__file__theretjoinRit
import_moduletTrueRRtTestCaseRRRMRIRcRrR(((s</opt/plesk/python/2.7/lib64/python2.7/test/test_urllibnet.pyt<module>s,

	
k3		

Zerion Mini Shell 1.0