tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
R\¬Qc@säddlZddlmZddlZddlZddlZddlZddlZejdde    ƒZ
d„Z dej fd„ƒYZ dej fd    „ƒYZd
ej fd „ƒYZd „Zed kràeƒndS(iÿÿÿÿN(t test_supportt    mimetoolst
deprecatedcOsWxJtdƒD]<}y||||ŽSWq tk
r?}q q ‚q Xq W|‚dS(Ni(trangetIOError(tfuncthosttargstkwargstitlast_exc((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt_open_with_retrys tURLTimeoutTestcBs)eZdZd„Zd„Zd„ZRS(g$@cCstj|jƒdS(N(tsockettsetdefaulttimeouttTIMEOUT(tself((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pytsetUp scCstjdƒdS(N(R RtNone(R((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyttearDown#scCs"ttjdƒ}|jƒ}dS(Nshttp://www.python.org/(R turllibturlopentread(Rtftx((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt testURLread&s(t__name__t
__module__RRRR(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyR s        turlopenNetworkTestscBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
RS(    s5Tests 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.python.org/ 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(R RR(RR((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyR9scCsi|jdƒ}x+d D]#}|jt||ƒd    |ƒqWz|j|jƒd
ƒWd|jƒXdS( Nshttp://www.python.org/Rtreadlinet    readlinestfilenotclosetinfotgeturls3object returned from urlopen lacks the %s attributescalling 'read' failed(sreadsreadlines    readlinessfilenosclosesinfosgeturl(Rt
assertTruethasattrRR (Rtopen_urltattr((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt
test_basic<s
 cCsW|jdƒ}z6|j|jƒtdƒ|j|jƒtdƒWd|jƒXdS(Nshttp://www.python.org/s readline did not return a stringsreadlines did not return a list(RtassertIsInstanceRt
basestringRtlistR (RR%((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyttest_readlinesHs cCs]|jdƒ}z|jƒ}Wd|jƒ|j|tjdƒ|j|jƒdƒXdS(Nshttp://www.python.org/sAobject returned by 'info' is not an instance of mimetools.Messagethtml(RR!R R(RtMessaget assertEqualt
getsubtype(RR%tinfo_obj((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt    test_infoSs
cCsGd}|j|ƒ}z|jƒ}Wd|jƒX|j||ƒdS(Nshttp://www.python.org/(RR"R R.(RtURLR%t
gotten_url((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt test_geturl_s  cCsMd}tjƒj|ƒ}z|jƒ}Wd|jƒX|j|dƒdS(Ns#http://www.python.org/XXXinvalidXXXi”(RtFancyURLopenertopentgetcodeR R.(RR2R%tcode((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt test_getcodeis  cCsytjdksttdƒ r#dS|jdƒ}|jƒ}tj|ƒ}z|j|jƒdƒWd|j    ƒXdS(Ntwin32tfdopenshttp://www.python.org/s<reading from file created using fd returned by fileno failed(swin32(
tsystplatformR$tosRRR;R#RR (RR%tfdtFILE((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt test_filenoss 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[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyttest_bad_addressƒs    ( RRt__doc__RR'R+R1R4R9RARG(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyR*s                     
   
   turlretrieveNetworkTestscBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s+Tests urllib.urlretrieve using the network.cGsttj|ŒS(N(R Rt urlretrieve(RR((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyRJ›scCsv|jdƒ\}}|jtjj|ƒdƒt|ƒ}z|j|jƒdƒWd|jƒtj|ƒXdS(Nshttp://www.python.org/s9file location returned by urlretrieve is not a valid paths=reading from the file location returned by urlretrieve failed(    RJR#R>tpathtexiststfileRR tunlink(Rt file_locationR!R@((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyR'žs 
cCsŒ|jdtjƒ\}}|j|tjƒ|jtjj|ƒƒt|ƒ}z|j|j    ƒdƒWd|j
ƒtj |ƒXdS(Nshttp://www.python.org/s"reading from temporary file failed( RJRtTESTFNR.R#R>RKRLRMRR RN(RROR!R@((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyttest_specified_path«s     
cCs<|jdƒ\}}tj|ƒ|j|tjdƒdS(Nshttp://www.python.org/s.header is not an instance of mimetools.Message(RJR>RNR(RR-(RROtheader((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt test_header¸s cCsyd}|j|ƒ\}}tj|ƒ|jdƒ}d}ytj||ƒWn!tk
rt|jd|ƒnXdS(NsBhttp://www.python.org/community/logos/python-logo-master-v3-TM.pngtDates%a, %d %b %Y %H:%M:%S GMTsDate value not in %r format(RJR>RNt    getheaderttimetstrptimet
ValueErrortfail(RtlogoROt fileheaderst    datevaluet
dateformat((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyttest_data_header¿s  (RRRHRJR'RQRSR^(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyRI˜s                 cCs@tjdƒtjdtfƒtjtttƒWdQXdS(Ntnetworks!urllib.urlopen.. has been removed(Rtrequirestcheck_py3k_warningstDeprecationWarningt run_unittestR RRI(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt    test_mainÌs      t__main__(tunittestttestRR RR<R>RVt import_moduletTrueRR tTestCaseR RRIRdR(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_urllibnet.pyt<module>s           n4