mò %U²Ic@s dkZdkZdkZdklZdklZdfd„ƒYZdeifd„ƒYZdefd„ƒYZ d „Zd „Z dd „Z eƒdS( N(sTestCase(s test_supportt FakeSocketcBs,tZeid„Zd„Zdd„ZRS(NcCs||_||_dS(N(ttexttselft fileclass(RRR((t./data/zmath/lib/python2.4/test/test_httplib.pyt__init__ s cCs ||_dS(N(tdataR(RR((RtsendallscCs:|djo|djotiƒ‚n|i|iƒS(Ntrtrb(tmodethttplibtUnimplementedFileModeRRR(RR tbufsize((Rtmakefiles(t__name__t __module__tStringIORRtNoneR(((RR s t NoEOFStringIOcBs&tZdZdd„Zed„ZRS(s¨Like StringIO, but raises AssertionError on EOF. This is used below to test that httplib doesn't try to read more from the underlying file than it should. iÿÿÿÿcCs6tii||ƒ}|djotdƒ‚n|S(Ntscaller tried to read past EOF(RtreadRtnRtAssertionError(RRR((RRs cCs6tii||ƒ}|djotdƒ‚n|S(NRscaller tried to read past EOF(RtreadlineRtlengthRR(RRR((RR"s (RRt__doc__RRR(((RRs  t HeaderTestscBstZd„ZRS(NcCsØdk}dtfd„ƒY}x²ttfD]¤}x›d D]“}|idƒ}t dƒ|_ |ƒ|_ d}h}|ott|ƒƒ||RARBR;((RttestMs      c CsMd}t|ƒ}ti|dƒ} | iƒ| iƒGH| iƒd}t|ƒ}ti|dƒ} y| iƒWnti j o dGHnXdGHxDdD]<}yti |ƒ}Wnti j o dGHqŸXd GHqŸWx¯ddd d!fD]›\}}}yti |ƒ}Wnti j o dGHnX|i}||ijotd||if‚n||ijotd||if‚qòqòWd} d}t| ƒ} ti| dƒ} | iƒ| idƒ}||jo td‚ntdtƒ}ti|dddƒ} | iƒ| iƒdjo td‚n| iƒdS("NsHTTP/1.1 200 Ok TextisHTTP/1.1 400.100 Not Ok Texts BadStatusLine raised as expectedsExpect BadStatusLineswww.python.org:abcswww.python.org:sInvalidURL raised as expectedsExpect InvalidURLs[fe80::207:e9ff:fe9b]:8000sfe80::207:e9ff:fe9bi@swww.python.org:80swww.python.orgiPs[fe80::207:e9ff:fe9b]sInvalidURL raised erroneouslysHost incorrectly parsedsPort incorrectly parseds¨HTTP/1.1 200 OK Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme" Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme" No body srCustomer="WILE_E_COYOTE"; Version="1"; Path="/acme", Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"s Set-Cookies&multiple headers not combined properlys*HTTP/1.1 200 OK Content-Length: 14432 tmethodtHEADRs)Did not expect response from HEAD request(swww.python.org:abcswww.python.org:(s[fe80::207:e9ff:fe9b]:8000sfe80::207:e9ff:fe9bi@(swww.python.org:80swww.python.orgiP(swww.python.orgswww.python.orgiP(s[fe80::207:e9ff:fe9b]sfe80::207:e9ff:fe9biP(R5RR3R t HTTPResponsetresptbeginRtcloset BadStatusLinethptHTTPtht InvalidURLtpthttpt_conntcthostRtportRthdrRARt getheadertcookiesR( R5RQRVRXRNRLRSR3RPRARRRH((RR?[s^                 cCstg}ti|ŒdS(N(Rttestst test_supportt run_unittest(tverboseRY((Rt test_main¤s ( R RR<tunittesttTestCaseRDRZRRRR?RR]( RZR_R RR?RRRR<R]RD((Rt?s      $  I