%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_cookielib.pyo

ó
Nêáac@s@dZddlZddlZddlZddlZddlmZmZmZmZddl	m
Z
ddlmZde
fd„ƒYZ
de
fd	„ƒYZd
fd„ƒYZd„Zd
„Zd„Zde
fd„ƒYZde
fd„ƒYZde
fd„ƒYZed„Zedkr<edeƒndS(sTests for cookielib.py.iÿÿÿÿN(t	http2timet	time2isoztiso2timet
time2netscape(tTestCase(ttest_supportt
DateTimeTestscBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsÅd}d
}|jt|ƒdƒ|jt||ƒdƒ|jt|d|ƒdƒ|jt|d|ƒd	ƒtƒ}td
ƒ}x1||fD]#}|j|dd||fƒqšWdS(Nix+À<iis2002-04-19 14:36:40Zs2002-04-20 14:36:40Zis2002-04-21 14:36:40Zis2002-04-22 14:36:40Zi ¡s!^\d{4}-\d\d-\d\d \d\d:\d\d:\d\dZ$sbad time2isoz format: %s %si€Q(tassertEqualRtassertRegexpMatches(tselftbasetdaytaztbzttext((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_time2isozs		cCsÅd}d
}|jt|ƒdƒ|jt||ƒdƒ|jt|d|ƒdƒ|jt|d|ƒd	ƒtƒ}td
ƒ}x1||fD]#}|j|dd||fƒqšWdS(Nix+À<iisFri, 19-Apr-2002 14:36:40 GMTsSat, 20-Apr-2002 14:36:40 GMTisSun, 21-Apr-2002 14:36:40 GMTisMon, 22-Apr-2002 14:36:40 GMTi ¡s;[a-zA-Z]{3}, \d{2}-[a-zA-Z]{3}-\d{4} \d{2}:\d{2}:\d{2} GMT$sbad time2netscape format: %s %si€Q(RRR(R	R
RRR
R((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_time2netscape s 	cCsOd„}|j|dƒd
ƒ|j|dƒdƒ|j|dƒdƒdS(NcSstjt|ƒƒd S(Ni(ttimetgmtimeR(R((s//usr/local/lib/python2.7/test/test_cookielib.pyt
parse_date7ss01 Jan 2001iÑiigs	03-Feb-20iäiis	03-Feb-98iÎ(iÑiiiig(iäiiiig(iÎiiiig(R(R	R((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_http2time6s	c
CsÝddddddddd	d
ddd
g
}d}t|ƒ}d}|j||d|||fƒxq|D]i}|jt|ƒ||ƒ|jt|jƒƒ||jƒƒ|jt|jƒƒ||jƒƒqlWdS(NsThu, 03 Feb 1994 00:00:00 GMTs Thursday, 03-Feb-94 00:00:00 GMTs"Thursday, 03-Feb-1994 00:00:00 GMTs03 Feb 1994 00:00:00 GMTs03-Feb-94 00:00:00 GMTs03-Feb-1994 00:00:00 GMTs03-Feb-1994 00:00 GMTs03-Feb-1994 00:00s	03-Feb-94s03-Feb-1994s03 Feb 1994s  03   Feb   1994  0:00  s  03-Feb-1994  i€>P-s1994-02-03 00:00:00Zs%s  =>  '%s' (%s)(RRRtlowertupper(R	tteststtest_ttresulttexpectedts((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_http2time_formatsBs,	
%c
Cs_xXddddddddd	d
g
D]2}|jt|ƒdkd|t|ƒfƒq%WdS(NttGarbagesMandag 16. September 1996s
01-00-1980s
01-13-1980s
00-01-1980s
32-01-1980s01-01-1980 25:00:00s01-01-1980 00:61:00s01-01-1980 00:00:62s,http2time(%s) is not None
http2time(test) %s(t
assertTrueRtNone(R	ttest((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_http2time_garbagefs
cCs2tdjddƒƒtdjddƒƒdS(Ns01 Jan 1970{}00:00:00 GMT!t i
is01 Jan 1970 00:00:00{}GMT!i †i †(Rtformat(R	((s//usr/local/lib/python2.7/test/test_cookielib.pyt2test_http2time_redos_regression_actually_completesxscCs2tdjddƒƒtdjddƒƒdS(Ns1994-02-03{}14:15:29 -0100!R#i
is1994-02-03 14:15:29{}-0100!i@Bi@B(RR$(R	((s//usr/local/lib/python2.7/test/test_cookielib.pyt$test_iso2time_performance_regressions(	t__name__t
__module__RRRRR"R%R&(((s//usr/local/lib/python2.7/test/test_cookielib.pyRs				$		tHeaderTestscBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsVddlm}ddd
gg}x-d	d
gD]}|j||gƒ|ƒq/WdS(Niÿÿÿÿ(tparse_ns_headerstfootbartexpiresld9Wtversiont0s)foo=bar; expires=01 Jan 2040 22:23:32 GMTs+foo=bar; expires="01 Jan 2040 22:23:32 GMT"(R+R,(R-ld9W(R.R/(t	cookielibR*R(R	R*Rthdr((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_parse_ns_headers_expiresˆs
cCsSddlm}d	d
gg}x-ddgD]}|j||gƒ|ƒq,WdS(Niÿÿÿÿ(R*R+R,R.t1sfoo=bar; version="1"sfoo=bar; Version="1"(R+R,(R.R3(R0R*R(R	R*RR1((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_parse_ns_headers_version“s
cCsBddlm}d}dd	gg}|j||gƒ|ƒdS(
Niÿÿÿÿ(R*s expires=01 Jan 2040 22:23:32 GMTR-s01 Jan 2040 22:23:32 GMTR.R/(R-s01 Jan 2040 22:23:32 GMT(R.R/(R0R*R(R	R*R1R((s//usr/local/lib/python2.7/test/test_cookielib.pyt#test_parse_ns_headers_special_namesžscCsRddlm}|dd	ggƒ}|j|dƒ|j|ggƒdƒdS(
Niÿÿÿÿ(tjoin_header_wordsR+R,tbazsfoo; bar=bazR(R+N(R,R7(R0R6R R(R	R6tjoined((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_join_header_words¨sc	Cs¥ddlm}ddggfddggfddggfddggfd	dggfd
d ggfdd!d"ggfd
d#d$ggfdd%ggfdd&d'ggfdd(d)d*ggfdd+gd,gd-ggfdd.d/gd0gd1gd2ggfg
}x•|D]\}}y||gƒ}WnKddl}ddl}|jƒ}|jd|ƒd|jƒ}nX|j||d|||fƒqWdS(3Niÿÿÿÿ(tsplit_header_wordsR+sfoo=barR,s	   foo   s
   foo=   Rs   foo=s   foo=   ; s   foo=   ; bar= baz R7sfoo=bar bar=bazsfoo= bar=bazsbar=bazsfoo=bar;bar=bazsfoo bar bazsa, b, ctatbtcs(foo; bar=baz, spam=, foo="\,\;\"", bar= tspams,;"s (error -- traceback follows)

%ss:
When parsing: '%s'
Expected:     '%s'
Got:          '%s'
(R+N(R+R,(R+N(R+R(R+R(R+R(R+R(R,R7(R+R,(R,R7(R+sbar=baz(R+R,(R,R7(R+N(R,N(R7N(R;N(R<N(R=N(R+N(R,R7(R>R(R+s,;"(R,R(R0R:R t	tracebacktStringIOt	print_exctgetvalueR(	R	R:RtargtexpectRR?R@tf((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_split_header_words°s4	cCsœddlm}m}ddddddd d!d"d#d$d%d&g
}xR|D]J\}}||gƒ}||ƒ}|j||d||||fƒqJWdS('Niÿÿÿÿ(R:R6R+sfoo=bars	   foo   sfoo=sfoo=""sfoo=bar bar=bazsfoo=bar; bar=bazsfoo=bar;bar=bazsfoo bar bazs
foo; bar; bazsfoo="\"" bar="\\"sfoo="\""; bar="\\"s	foo,,,barsfoo, barsfoo=bar,bar=bazsfoo=bar, bar=bazstext/html; charset=iso-8859-1stext/html; charset="iso-8859-1"s)foo="bar"; port="80,81"; discard, bar=bazs'foo=bar; port="80,81"; discard, bar=bazsBasic realm="\"foo\\\\bar\""sBasic; realm="\"foo\\\\bar\""sM
When parsing: '%s'
Expected:     '%s'
Got:          '%s'
Input was:    '%s'
(R+R+(sfoo=barsfoo=bar(s	   foo   R+(sfoo=sfoo=""(sfoo=bar bar=bazsfoo=bar; bar=baz(sfoo=bar;bar=bazsfoo=bar; bar=baz(sfoo bar bazs
foo; bar; baz(sfoo="\"" bar="\\"sfoo="\""; bar="\\"(s	foo,,,barsfoo, bar(sfoo=bar,bar=bazsfoo=bar, bar=baz(stext/html; charset=iso-8859-1stext/html; charset="iso-8859-1"(s)foo="bar"; port="80,81"; discard, bar=bazs'foo=bar; port="80,81"; discard, bar=baz(sBasic realm="\"foo\\\\bar\""sBasic; realm="\"foo\\\\bar\""(R0R:R6R(R	R:R6RRCRDtinputtres((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_roundtripÔs,	(R'R(R2R4R5R9RFRI(((s//usr/local/lib/python2.7/test/test_cookielib.pyR)†s			
		$tFakeResponsecBs eZgdd„Zd„ZRS(cCsOddl}ddl}|jdj|ƒƒ}|j|ƒ|_||_dS(sD
        headers: list of RFC822-style 'Key: value' strings
        iÿÿÿÿNs
(t	mimetoolsR@tjointMessaget_headerst_url(R	theadersturlRKR@RE((s//usr/local/lib/python2.7/test/test_cookielib.pyt__init__ùscCs|jS(N(RN(R	((s//usr/local/lib/python2.7/test/test_cookielib.pytinfoRN(R'R(R RRRS(((s//usr/local/lib/python2.7/test/test_cookielib.pyRJøscGst|||dƒS(NsSet-Cookie2(t	_interact(t	cookiejarRQtset_cookie_hdrs((s//usr/local/lib/python2.7/test/test_cookielib.pyt
interact_2965scGst|||dƒS(Ns
Set-Cookie(RT(RURQRV((s//usr/local/lib/python2.7/test/test_cookielib.pytinteract_netscapesc
CsŒddlm}||ƒ}|j|ƒ|jddƒ}g}x%|D]}|jd||fƒqHWt||ƒ}	|j|	|ƒ|S(sDPerform a single request / response cycle, returning Cookie: header.iÿÿÿÿ(tRequesttCookieRs%s: %s(turllib2RYtadd_cookie_headert
get_headertappendRJtextract_cookies(
RURQRVthdr_nameRYtreqt
cookie_hdrRPR1RH((s//usr/local/lib/python2.7/test/test_cookielib.pyRT	s

tFileCookieJarTestscBseZd„Zd„ZRS(cCsÖddlm}tj}|ƒ}t|ddƒ|j|jdddjdƒz3|j	|dt
ƒ|ƒ}|j|dt
ƒWdytj
|ƒWntk
r®nXX|j|jdddjdƒdS(Niÿÿÿÿ(tLWPCookieJarshttp://www.acme.com/tbooswww.acme.comt/tignore_discard(R0RdRtTESTFNRXRt_cookiestvalueR tsavetTruetloadtostunlinktOSError(R	RdtfilenameR=((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_lwp_valueless_cookies		"	
c	Csddlm}m}m}tj}xg||fD]Y}|ƒ}y|jddƒWn&tk
r}}|j|j	tƒq2X|j
dƒq2WzVt|dƒ}|jdƒx3||fD]%}|ƒ}|j
||j|ƒq»WWdytj|ƒWntk
rnXXdS(Niÿÿÿÿ(RdtMozillaCookieJart	LoadErrorRqsAfor this test to work, a file with this filename should not exists%expected IOError for invalid filenametwsoops
(R0RdRsRtRRhRmtIOErrorRt	__class__tfailtopentwritetassertRaisesRnRoRp(	R	RdRsRtRqtcookiejar_classR=texcRE((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_bad_magic(s&		
	
(R'R(RrR~(((s//usr/local/lib/python2.7/test/test_cookielib.pyRcs	tCookieTestscBs(eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!RS( c	Csjddl}ddl}|jƒ}x?ddtfddtfddtfddtfddtfddtfdd	tfdd
tfddtfdd
tfddtfdd
tfddtfddtfddtfddtfddtfdd
tfddtfgD]S\}}}|j|ƒ}|j||ƒ}|rU|j|ƒq|j|ƒqWdS(Niÿÿÿÿshttp://foo.bar.com/sblah.comsrhubarb.blah.comsrhubarb.foo.bar.coms.foo.bar.comsfoo.bar.coms.bar.comsbar.comtcomshttp://foo.com/srhubarb.foo.coms.foo.comsfoo.comshttp://foo/srhubarb.foos.fooR+s	foo.locals.localshttp://barfoo.com(	R0R[tDefaultCookiePolicytFalseRlRYtdomain_return_okRtassertFalse(	R	R0R[tpolRQtdomaintoktrequesttr((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_domain_return_okqs6cCswddlm}m}tj}||ƒ}t|ddƒt|ddƒ|jddd}|j|jƒ|j	|j
dƒ|jddd	}|j|jƒ|j	|j
d	ƒ|j	||ƒd
ƒt|ƒ}|jdt
dt
ƒz&||ƒ}|jdt
dt
ƒWdtj|jƒX|j	t|ƒtjd
t
d
t|ƒƒ|j	t|dƒdƒdS(Niÿÿÿÿ(Rstlwp_cookie_strshttp://www.acme.com/teggss"spam"; path=/foo/swww.acme.comRfs/foo/s"spam"sJ"spam"; path="/foo/"; domain="www.acme.com"; path_spec; discard; version=0tignore_expiresRgspath_specified=%sshttp://www.acme.com/foo/s"spam"; eggs(R0RsR‹RRhRXRitassertIsNoneRjRtnametreprRkRltrevertRnRoRqtretsubR‚(R	RsR‹RqR=tcookietold_str((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_missing_value“s2		
c
Cs;ddlm}m}xdtdfdtdfttdfttdfttdfttdfgD]Î\}}}|d|d|ƒ}||ƒ}t|ddƒy|jd	d
d}Wntk
rÞ|j	|ƒqeX|j
|j|ƒt|ddƒ|re|jd	d
d
}	|j
|	jdƒqeqeWdS(Niÿÿÿÿ(t	CookieJarRiitrfc2109_as_netscapetrfc2965shttp://www.example.com/sni=ni; Version=1swww.example.comRftnisfoo=bar; Version=1R+(
R0R—RR R‚RlRXRitKeyErrorRŽRR.RW(
R	R—RR˜R™R.tpolicyR=R”t
cookie2965((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_rfc2109_handlingµs.	
	cCsaddlm}m}|ƒ}t|ddƒt|ddƒt|ddƒt|ddƒt|dd	ƒt|dd
ƒt|ddƒt|ddƒ|jd
dd}|j|jd
ƒ|j|jƒ|j|j	|ƒ|j
|jƒ|j|jdƒƒ|j
|jdƒƒ|jddd}|j|jdƒ|j
|jƒ|j|j	dƒ|j|jƒ|jddd}|j
|j	ƒ|j
|jƒ|jddd}|jddd}|j
|jƒ|j
|jƒ|jddd}|j|jƒ|j|jdƒ|jddd}|j
|jƒdS(Niÿÿÿÿ(R—tDEFAULT_HTTP_PORTshttp://www.acme.com/s0spam=eggs; DoMain=.acme.com; port; blArgh="feep"sni=ni; port=80,8080shttp://www.acme.com:80/snini=nisfoo=bar; expires=s-spam=eggs; expires="Foo Bar 25 33:22:11 3022"s	fortytwo=s=unladenswallowtholyhandgrenades	.acme.comRfR>tblArghtblarghswww.acme.comRšs80,8080tniniR+tfortytwoR(R0R—RŸRXRiRR†Rtdomain_specifiedtportR„tport_specifiedthas_nonstandard_attrRŽR-tassertIsNotNoneRj(R	R—RŸR=R”R+R>((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_ns_parserÖsF		cCstddlm}|ƒ}t|ddƒt|ddƒ|jdd}|jd|kƒ|jd	|kƒdS(
Niÿÿÿÿ(R—shttp://www.acme.com/sexpires=eggssversion=eggs; spam=eggsswww.acme.comRfR-R.(R0R—RXRiR(R	R—R=tcookies((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_ns_parser_special_namess	cCs²ddlm}m}|ƒ}|tjƒdƒ}t|dd|ƒ|jt|ƒdƒ|tjƒdƒ}t|dd|ƒt|dƒ}|jt|ƒdƒ|jd|koÉd	|kƒt|dd
|ƒt|dd|ƒ|jt|ƒdƒt|dd
|ƒt|dd|ƒt|dƒ}|jt|ƒdƒt|ddƒ|jt|ƒdƒ|jƒ|jt|ƒdƒ|j	d|ƒdS(Niÿÿÿÿ(RR—ishttp://www.acme.com/sspam="bar"; expires=%sisfoo="eggs"; expires=%ss
spam="bar"R+seggs="bar"; expires=%ssbar="bar"; expires=%sis!eggs="bar"; expires=%s; max-age=0s bar="bar"; max-age=0; expires=%sshttp://www.rhubarb.net/swhum="fizz"i(
R0RR—RRXRtlenRtclear_session_cookiestassertIn(R	RR—R=tfuturetnowth((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_expiress8	
cCsµddlm}m}|dtƒ}||ƒ}t|ddƒ|jd|jdƒ||ƒ}t|dd	ƒ|jd|jdƒ||ƒ}t|d
d	ƒ|jd|jdƒ||ƒ}t|dd	ƒ|jd
|jdƒ|ƒ}t|ddƒ|jd|jdƒ|ƒ}t|ddƒ|jd|jdƒ|ƒ}t|d
dƒ|jd|jdƒ|ƒ}t|ddƒ|jd|jdƒdS(Niÿÿÿÿ(R—RR™shttp://www.acme.com/sspam="bar"; Version="1"Rfswww.acme.comshttp://www.acme.com/blahseggs="bar"; Version="1"s http://www.acme.com/blah/rhubarbs/blah/s!http://www.acme.com/blah/rhubarb/s/blah/rhubarb/s
spam="bar"s
eggs="bar"s/blahs
/blah/rhubarb(R0R—RRlRWR¯RiRX(R	R—RR…R=((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_default_path=s8						cCs\tjƒ}d}d}t|||ƒ|jd|jdƒ|jt||ƒ|ƒdS(Nshttp://example.com/?spam/eggss
eggs="bar"Rfsexample.com(R0R—RXR¯RiR(R	tcjturiRj((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_default_path_with_querygscCshddlm}dddddddddddg}x*|D]"\}}|j||ƒ|ƒq>WdS(Niÿÿÿÿ(tescape_paths/foo%2f/bars/foo%2F/bars
/foo%%/bars/fo%19o/bars/fo%7do/bars/fo%7Do/bars	/foo/bar&s	/foo//bars	~/foo/bars	/foo/bars/foo%19/bars	/}foo/bars/%7Dfoo/baru/foo/barê¯s/foo/bar%EA%AF%8D(s/foo%2f/bars/foo%2F/bar(s/foo%2F/bars/foo%2F/bar(s
/foo%%/bars
/foo%%/bar(s/fo%19o/bars/fo%19o/bar(s/fo%7do/bars/fo%7Do/bar(s	/foo/bar&s	/foo/bar&(s	/foo//bars	/foo//bar(s	~/foo/bars	~/foo/bar(s	/foo/bars/foo%19/bar(s	/}foo/bars/%7Dfoo/bar(u/foo/barê¯s/foo/bar%EA%AF%8D(R0R¸R(R	R¸tcasesRCR((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_escape_pathqs	cCsŠddlm}ddlm}|dƒ}|j||ƒdƒ|dƒ}|j||ƒdƒ|dƒ}|j||ƒd	ƒdS(
Niÿÿÿÿ(RY(trequest_pathsThttp://www.example.com/rheum/rhaponticum;foo=bar;sing=song?apples=pears&spam=eggs#nis$/rheum/rhaponticum;foo=bar;sing=songsBhttp://www.example.com/rheum/rhaponticum?apples=pears&spam=eggs#nis/rheum/rhaponticumshttp://www.example.comRf(R[RYR0R»R(R	RYR»Ra((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_request_path‰scCs]ddlm}m}ddlm}|ƒ}|dtƒ}||ƒ}d}t||dƒ|jddd	}xádtfd
tfdtfdtfd
tfgD]¬\}	}
dj	||	ƒ}||ƒ}t||ƒ}
|
r |j
d|
dj	|	ƒƒ|j|j||ƒƒq©|j
d|
dj	|	ƒƒ|j|j||ƒƒq©WdS(Niÿÿÿÿ(R—R(RYtstrict_ns_set_pathshttp://bar.comsspam=eggs; Path=/foosbar.coms/fooR>s/foo/s/foo/barRfs/foobad/foos{0}{1}s	spam=eggsscookie not set for {0}scookie set for {0}(R0R—RR[RYRlRXRiR‚R$R¯Rtset_ok_pathtassertNotInR„(R	R—RRYR…tstrict_ns_path_polR=tbase_urlR”tpathR‡RQRaR²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_path_prefix_match™s.				cCsˆddlm}ddlm}m}|ddidd6ƒ}|j||ƒdƒ|d	didd6ƒ}|j||ƒ|ƒdS(
Niÿÿÿÿ(RY(trequest_portRŸshttp://www.acme.com:1234/RPswww.acme.com:4321tHostt1234shttp://www.acme.com/(R[RYR0RÄRŸR(R	RYRÄRŸRa((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_request_port¶s		cCsàddlm}ddlm}|ddidd6ƒ}|j||ƒdƒ|d	did
d6ƒ}|j||ƒdƒ|ddidd6ƒ}|j||ƒdƒ|d
didd6ƒ}|j||ƒdƒdS(Niÿÿÿÿ(RY(trequest_hostshttp://1.1.1.1/RPswww.acme.com:80RÅs1.1.1.1shttp://www.acme.com/sirrelevant.comswww.acme.coms/resource.htmls&http://www.acme.com:2345/resource.htmlswww.acme.com:5432(R[RYR0RÈR(R	RYRÈRa((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_request_hostÀs				cCs¬ddlm}|j|dƒƒ|j|dƒƒ|j|dƒƒ|j|dƒƒ|j|dƒƒ|j|dƒƒ|j|d	ƒƒ|j|d
ƒƒdS(Niÿÿÿÿ(tis_HDNsfoo.bar.coms1foo2.3bar4.5coms192.168.1.1Rt.s.foo.bar.coms..foosfoo.(R0RÊRR„(R	RÊ((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_is_HDN×scCsÄddlm}|j|dƒdƒ|j|dƒdƒ|j|dƒdƒ|j|dƒdƒ|j|dƒdƒ|j|d	ƒd	ƒ|j|d
ƒd
ƒ|j|dƒdƒdS(Niÿÿÿÿ(treachswww.acme.coms	.acme.comsacme.coms
acme.locals.locals.comRËRs192.168.0.1(R0RÍR(R	RÍ((s//usr/local/lib/python2.7/test/test_cookielib.pyt
test_reachâscCsÄddlm}m}|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|d	d
ƒƒ|j|d
d	ƒƒ|j|ddƒƒ|j|d
dƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒ|j|ddƒƒdS(Niÿÿÿÿ(tdomain_matchtuser_domain_matchs192.168.1.1s.168.1.1sx.y.comsx.Y.coms.Y.comsY.coms	a.b.c.coms.c.coms
example.locals.locals	blah.blahRs.rhubarb.rhubarbsacme.coms	.acme.comsrhubarb.acme.comswww.rhubarb.acme.comsy.coms.y.coms.comR€tms.mRË(R0RÏRÐRR„(R	RÏRÐ((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_domain_matchís@cCsCddlm}|ƒ}t|ddƒ|jt|ƒdƒdS(Niÿÿÿÿ(R—shttp://www.nasty.com/s)foo=bar; domain=friendly.org; Version="1"i(R0R—RWRR­(R	R—R=((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_wrong_domains
		cCsµddlm}m}|dtƒ}|d|ƒ}t|ddƒt|ddƒ|jt|ƒdƒxDd	d
ddgD]0}t|d
|dƒ|jt|ƒdƒq}WdS(Niÿÿÿÿ(R—Rt
strict_domainRœshttp://example.co.uk/sno=problemos!okey=dokey; Domain=.example.co.ukis.co.uks.org.zas.tx.uss.name.usshttp://example.%s/sspam=eggs; Domain=.co.uk(R0R—RRlRXRR­(R	R—RtcpRµt
pseudo_tld((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_strict_domains	
cCs´ddlm}m}|ƒ}t|ddƒ|jt|ƒdƒ|j|jdddjd	ƒ|jt|dƒdƒ|jt|d
ƒdƒ|d|jƒ}|j	|ƒ|jt|d
ƒdƒt|d
dƒt|ddƒ|jt|ƒdƒ|j|jdddjdƒ|j|jdddjdƒ|jt|dƒdƒt|ddƒ|jt|ƒdƒt|ddƒ|jt|ƒdƒdS(Niÿÿÿÿ(R—Rshttp://foo.net/sns=barisfoo.netRftnsR,shttp://www.foo.net/tstrict_ns_domainRshttp://foo.net/foo/sspam1=eggs; domain=foo.netshttp://foo.net/foo/bar/sspam2=eggs; domain=.foo.netis.foo.nets/footspam1RŒs/foo/bartspam2sspam2=eggs; spam1=eggs; ns=barsnini="ni"; domain=.netshttp://foo.co.uksnasty=trick; domain=.co.uki(
R0R—RRXRR­RiRjtDomainStrictNonDomaint
set_policy(R	R—RR=R…((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_two_component_domain_ns-s6	"
		cCs´ddlm}m}|dtƒ}||ƒ}t|ddƒ|jt|ƒdƒ|j|jddd	jd
ƒ|jt|dƒdƒ|jt|dƒd
ƒt|ddƒ|jt|ƒdƒ|jt|dƒdƒt|ddƒ|j|jdddjdƒ|jt|ƒdƒ|jt|dƒdƒ|jt|dƒdƒt|ddƒ|jt|ƒdƒt|ddƒ|jt|ƒdƒdS(Niÿÿÿÿ(R—RR™shttp://foo.net/sfoo=bar; Version="1"isfoo.netRfR+R,s$Version=1; foo=barshttp://www.foo.net/Rshttp://foo.net/foos1spam=eggs; domain=foo.net; path=/foo; Version="1"shttp://www.foo.net/foo/s&spam=eggs; domain=foo.net; Version="1"s.foo.nets/foo/R>RŒishttp://foo.net/foo/s($Version=1; spam=eggs; $Domain="foo.net"s#ni="ni"; domain=".net"; Version="1"shttp://foo.co.uk/s'nasty=trick; domain=.co.uk; Version="1"i(	R0R—RRlRWRR­RiRj(R	R—RR…R=((s//usr/local/lib/python2.7/test/test_cookielib.pyt!test_two_component_domain_rfc2965_s:"				c	Cs‘ddlm}m}ddlm}|d|ddgddgƒƒ}|d	ƒ}d
g}t|d	ƒ}|j||ƒ|jt|ƒdƒ|dƒ}t|dƒ}|j||ƒ|jt|ƒd
ƒ|dƒ}t|dƒ}|j||ƒ|jt|ƒd
ƒ|dƒ}t|dƒ}|j	||ƒ}|j
|dƒ|jt|ƒdƒ|j|ƒ|j|j
dƒƒdS(Niÿÿÿÿ(R—R(RYRœtblocked_domainssacme.comtallowed_domainsswww.acme.comshttp://acme.com/s*Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/ishttp://www.acme.com/ishttp://www.coyote.com/iRZ(R0R—RR[RYRJR_RR­tmake_cookiest
set_cookieR\R„t
has_header(	R	R—RRYR=RaRPRHR«((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_domain_allows2		
cCsoddlm}m}ddlm}|dtddgƒ}|d|ƒ}dg}|d	ƒ}t|d	ƒ}|j||ƒ|jt	|ƒd
ƒ|j
dgƒ}	|j||ƒ|jt	|ƒdƒ|jƒ|d
ƒ}t|d
ƒ}|j||ƒ|jt	|ƒdƒ|d
ƒ}|j|ƒ|j
|jdƒƒ|j
|jdƒƒ|jƒ|j
dgƒ|j||ƒ|jt	|ƒdƒ|d	ƒ}t|d	ƒ}|j||ƒ}
|j|
d
ƒ|jt	|ƒdƒ|j|ƒ|j|jdƒƒ|jƒ|j
gƒ|dƒ}t|dƒ}|j||ƒ}
|j||ƒ|jt	|ƒdƒ|dƒ}|j|ƒ|j
|jdƒƒ|dƒ}|j|ƒ|j|j|
d
|ƒƒ|j|jdƒƒ|j
dgƒ}	|dƒ}|j|ƒ|j|jdƒƒ|dƒ}|j|ƒ|j|jdƒƒdS(Niÿÿÿÿ(R—R(RYR™Ràs	.acme.comRœs*Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/shttp://www.acme.com/isacme.comishttp://www.roadrunner.net/RZtCookie2ishttp://acme.com/shttp://badacme.com/(R0R—RR[RYRlRJR_RR­tset_blocked_domainstclearR\RRäRâRãR„t	return_ok(R	R—RRYR…R=RPRaRHtpR«((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_domain_block¯sl	









c
Csddlm}m}xøttfD]ê}xádD]Ù}|ƒ}|rc|dtƒ}t}d}n|dtƒ}t}d}|j|ƒd}	|||	d||fƒ|||	d	||fƒ|j|j	d
ddj
d
ƒ|j|j	d
ddj
dƒq0Wq#WdS(Niÿÿÿÿ(R—RR#RR™s; Version=1shttp://www.acme.com/sfoo1=bar%s%ssfoo2=bar%s; secure%sswww.acme.comRftfoo1s#non-secure cookie registered securetfoo2s#secure cookie registered non-secure(R#R(R0R—RRlR‚RXRWRÝR„RitsecureR(
R	R—RRØt
whitespaceR=R…tinttvsRQ((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_secureõs*
		
cCsaddlm}m}|d|dtƒƒ}t|ddƒt|dƒ}|j|dƒdS(Niÿÿÿÿ(R—RRœR™shttp://www.acme.com/sfoo=\b"a"r; Version=1s$Version=1; foo=\\b\"a\"r(R0R—RRlRWR(R	R—RR=R²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_quote_cookie_values
cCsšddlm}m}ddlm}d}||dtƒƒ}t||dƒ||ƒ}|jt|ƒdƒ|j	|ƒ|j
|jdƒƒdS(	Niÿÿÿÿ(R—R(RYshttp://www.acme.comR™sfoo=bar; Version=1iRZ(R0R—RR[RYRlRWRR­R\RRä(R	R—RRYRQR=Ra((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_missing_final_slashs
cCsõddlm}m}|dtƒ}||ƒ}d}t||dƒt||ƒ}|jd|dƒ||ƒ}d}t||dƒt||ƒ}|jd	|d
ƒ||ƒ}d}t||dƒt||ƒ}|jd|d
ƒdS(
Niÿÿÿÿ(R—RR™shttp://foo.bar.com/sspam=eggs; Version=1tDomains*absent domain returned with domain presents%spam=eggs; Version=1; Domain=.bar.coms$Domain=".bar.com"sdomain not returneds$spam=eggs; Version=1; Domain=bar.coms$Domain="bar.com"(R0R—RRlRWR¿R¯(R	R—RR…R=RQR²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_domain_mirror!s$cCs±ddlm}m}|dtƒ}||ƒ}d}t||dƒt||ƒ}|jd|dƒ||ƒ}d}t||dƒt||ƒ}|jd	|d
ƒdS(Niÿÿÿÿ(R—RR™shttp://foo.bar.com/sspam=eggs; Version=1tPaths&absent path returned with path presentsspam=eggs; Version=1; Path=/s	$Path="/"spath not returned(R0R—RRlRWR¿R¯(R	R—RR…R=RQR²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_path_mirror:scCs9ddlm}m}|dtƒ}||ƒ}d}t||dƒt||ƒ}|jd|dƒ||ƒ}d}t||dƒt||ƒ}|j|d	d
ƒ||ƒ}d}t||dƒt||ƒ}|jd|d
ƒ||ƒ}d}t||dƒt||ƒ}|jd|dƒdS(Niÿÿÿÿ(R—RR™shttp://foo.bar.com/sspam=eggs; Version=1tPorts&absent port returned with port presentsspam=eggs; Version=1; Ports\$Port([^=]|$)s-port with no value not returned with no valuesspam=eggs; Version=1; Port="80"s
$Port="80"s5port with single value not returned with single values$spam=eggs; Version=1; Port="80,8080"s$Port="80,8080"s;port with multiple values not returned with multiple values(R0R—RRlRWR¿RR¯(R	R—RR…R=RQR²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_port_mirrorKs2cCsgddlm}m}||dtƒƒ}d}t||dƒt||ƒ}|jd|dƒdS(Niÿÿÿÿ(R—RR™shttp://foo.bar.com/sfspam=eggs; Version=1; Comment="does anybody read these?"; CommentURL="http://foo.bar.net/comment.html"tComments:Comment or CommentURL cookie-attributes returned to server(R0R—RRlRWR¿(R	R—RR=RQR²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_no_return_commentlscCs}ddlm}m}m}||dtƒƒ}t|ddƒt|ddƒt|ddƒt|dd	ƒt|d
dƒdddd
dg}dddddg}dddddg}dddddg}x¡tdƒD]“}	d
}	x„|D]|}
|j|
|ƒ|j	|
j
||	ƒ|j	|
j||	ƒ|j	|
j||	ƒ|j	|
j
||	ƒ|	d}	qõWqâWdS(Niÿÿÿÿ(R—RZRR™shttp://blah.spam.org/sefoo=eggs; Version=1; Comment="does anybody read these?"; CommentURL="http://foo.bar.net/comment.html"shttp://www.acme.com/blah/sspam=bar; securesfoo=bar; secure; Version=1sfoo=bar; path=/; Version=1shttp://www.sol.nossbang=wallop; version=1; domain=".sol.no"; port="90,100, 80,8080"; max-age=100; Comment = "Just kidding! (\"|\\\\) "iitbangR+R>s.sol.nos
blah.spam.orgswww.acme.comRfs/blahs/blah/i(R0R—RZRRlRWRXtrangetassertIsInstanceRR.RR†RÂ(R	R—RZRtcstversionstnamestdomainstpathstiR=((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_Cookie_iteratorxs0				
cCsãddlm}|j|dgƒddddggƒ|j|dgƒdddggƒ|j|dgƒddggƒ|j|d
gƒdddggƒ|j|dgƒddggƒ|j|dgƒgƒdS(Niÿÿÿÿ(R*sfoo=bar; path=/; domainR+R,RÂRfR†R.R/s)foo=bar; expires=Foo Bar 12 33:22:11 2000R-sfoo=bar; expiressfoo=bar; versionR(R+R,(RÂRf(R†N(R.R/(R+R,(R-N(R.R/(R+N(R.R/(R+R,(R-N(R.R/(R+R,(R.N(R0R*RR (R	R*((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_parse_ns_headersšs$cCs»d„}tjtjƒdƒ}xXdgdgdgdgdgd|ggD](}||ƒ}|jt|ƒd	ƒqQWd
g}||ƒ}|jddd
}|j|jƒdS(NcSsXddlm}ddlm}|ƒ}|dƒ}t|dƒ}|j||ƒ|S(Niÿÿÿÿ(R—(RYshttp://www.example.com/(R0R—R[RYRJR_(RPR—RYR=RaR‰((s//usr/local/lib/python2.7/test/test_cookielib.pytcookiejar_from_cookie_headers¹s	isSet-Cookie: s
Set-Cookie2: s-Set-Cookie2: a=foo; path=/; Version=1; domainsSet-Cookie: b=foo; max-age=oopssSet-Cookie: b=foo; version=spamsSet-Cookie:; Expires=%sis3Set-Cookie: c=foo; expires=Foo Bar 12 33:22:11 2000swww.example.comRfR=(R0RRRR­RiRŽR-(R	RR°RPR=R”((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_bad_cookie_header·s			("R'R(RŠR–RžRªR¬R³R´R·RºR¼RÃRÇRÉRÌRÎRÒRÓR×RÞRßRåRëRòRóRôRöRøRúRüRRR	(((s//usr/local/lib/python2.7/test/test_cookielib.pyRBs@/	"	"	!	2	
	(	*	
				
				%			2	.	"	F						!		"	tLWPCookieTestscBsteZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
RS(c
CsCddlm}m}ddlm}tjƒdd}g}||dtƒƒ}|ddid	d
6ƒ}|jd|ƒt	|dƒ}|j
||ƒ|dƒ}|j|ƒ|j|j
d
ƒdƒ|j|j
dƒdƒ|jdƒt	|dƒ}|j
||ƒ|dƒ}|j|ƒ|j
d
ƒ}	|jd|	ƒ|jd|	ƒ|jdƒt	|dƒ}|j
||ƒ|dƒ}|j|ƒ|j
d
ƒ}	|jd|	ƒ|jd|	ƒ|jd|	ƒ|dƒ}|j|ƒ|j
d
ƒ}	|jd|	ƒ|jd|	ƒ|j|	jdƒƒdS(Niÿÿÿÿ(R—R(RYiiR™shttp://www.acme.com:80/RPswww.acme.com:80RÅsVSet-Cookie: CUSTOMER=WILE_E_COYOTE; path=/ ; expires=Wednesday, 09-Nov-%d 23:12:40 GMTshttp://www.acme.com/RZsCUSTOMER=WILE_E_COYOTERæs$Version="1"s4Set-Cookie: PART_NUMBER=ROCKET_LAUNCHER_0001; path=/shttp://www.acme.com/foo/bars PART_NUMBER=ROCKET_LAUNCHER_0001s%Set-Cookie: SHIPPING=FEDEX; path=/fooshttp://www.acme.comsSHIPPING=FEDEXshttp://www.acme.com/foo/sSHIPPING=FEDEX;(R0R—RR[RYRt	localtimeRlR^RJR_R\RR]R¯R¿Rt
startswith(
R	R—RRYt
year_plus_oneRPR=RaRHR²((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_netscape_example_1ÞsN&	





cCsûddlm}ddlm}|ƒ}g}|dƒ}|jdƒt|dƒ}|j||ƒ|dƒ}|j|ƒ|j|j	dƒdƒ|jdƒt|dƒ}|j||ƒ|d	ƒ}|j|ƒ|j
|j	dƒd
ƒdS(Niÿÿÿÿ(R—(RYshttp://www.acme.com/s4Set-Cookie: PART_NUMBER=ROCKET_LAUNCHER_0001; path=/RZs PART_NUMBER=ROCKET_LAUNCHER_0001s6Set-Cookie: PART_NUMBER=RIDING_ROCKET_0023; path=/ammoshttp://www.acme.com/ammosBPART_NUMBER=RIDING_ROCKET_0023;\s*PART_NUMBER=ROCKET_LAUNCHER_0001(R0R—R[RYR^RJR_R\RR]R(R	R—RYR=RPRaRH((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_netscape_example_2<s(	


cCsáddlm}m}||dtƒƒ}t|ddƒ}|j|ƒt|ddƒ}|j|dƒt|d	d
ƒ}|j|dƒ|j|dƒ|j|d
ƒt|dƒ}|j|dƒ|jd|ƒdS(Niÿÿÿÿ(R—RR™shttp://www.acme.com/acme/logins3Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"s!http://www.acme.com/acme/pickitems=Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"s=^\$Version="?1"?; Customer="?WILE_E_COYOTE"?; \$Path="/acme"$s!http://www.acme.com/acme/shippings+Shipping="FedEx"; Version="1"; Path="/acme"s^\$Version="?1"?;s7Part_Number="?Rocket_Launcher_0001"?;\s*\$Path="\/acme"s-Customer="?WILE_E_COYOTE"?;\s*\$Path="\/acme"s http://www.acme.com/acme/processs%Shipping="?FedEx"?;\s*\$Path="\/acme"t
WILE_E_COYOTE(R0R—RRlRWR„RR¯(R	R—RR=R”((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_ietf_example_1rs*	
								cCsddlm}m}||dtƒƒ}t|dddƒt|dƒ}|j|dƒt|d	ƒ}|jd
|ƒ|jd|ƒdS(Niÿÿÿÿ(R—RR™s&http://www.acme.com/acme/ammo/specifics=Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"s@Part_Number="Riding_Rocket_0023"; Version="1"; Path="/acme/ammo"s!http://www.acme.com/acme/ammo/...s(Riding_Rocket_0023.*Rocket_Launcher_0001shttp://www.acme.com/acme/parts/tRocket_Launcher_0001tRiding_Rocket_0023(R0R—RRlRWRR¯R¿(R	R—RR=R”((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_ietf_example_2äs
	c	Cszddlm}m}|dtƒ}|d|ƒ}d}t|ddƒ}|j|ƒt|ddƒ}|jt|ƒd	ƒt|d
dƒ}|jt|ƒd	ƒt|d
dƒ}|jt|ƒd
ƒt|ddƒ}|jt|ƒd
ƒt|ddƒ}|jt|ƒd
ƒt|ddƒ}|jt|ƒdƒt|ddƒ}|jt|ƒdƒt|ddƒ}|jt|ƒdƒt|ddƒ}|jt|ƒdƒt|ddƒ}|jt|ƒdƒtj	}zE|j
|dtƒt|ƒ}|d|ƒ}|j|dtƒWdyt
j|ƒWntk
r^nXX|j|t|ƒƒdS(Niÿÿÿÿ(RRdR™Rœsmax-age=3600shttp://www.acme.coms!foo=bar; domain=".com"; version=1s'ping=pong; domain="acme.com"; version=1ishttp://www.a.acme.coms'whiz=bang; domain="acme.com"; version=1s,wow=flutter; domain=".a.acme.com"; version=1ishttp://125.125.125.125s*zzzz=ping; domain="125.125.125"; version=1shttp://www.sol.nos6blah=rhubarb; domain=".sol.no"; path="/foo"; version=1shttp://www.sol.no/foo/bars3bing=bong; domain=".sol.no"; path="/foo"; version=1is5whiz=ffft; domain=".sol.no"; port="90,100"; version=1ssbang=wallop; version=1; domain=".sol.no"; port="90,100, 80,8080"; max-age=100; Comment = "Just kidding! (\"|\\\\) "is9foo9=bar; version=1; domain=".sol.no"; port; max-age=100;ishttp://www.sol.no/<oo/s"foo8=bar; version=1; path="/%3coo"iRg(R0RRdRlRWR„RR­RRhRkRRmRnRoRp(	R	RRdR…R=tmax_ageR”Rqtold((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_rejectionsb		
																					
cCs±ddlm}m}||dtƒƒ}t|ddƒt|ddƒ}tjdtjƒ}|jd	|ƒ|j	||ƒt|d
ƒ}|j
|ƒt|dƒ}dS(Niÿÿÿÿ(R—RR™s1http://www.acme.com/foo%2f%25/%3c%3c%0Anew%E5/%E5sfoo  =   bar; version    =   1s+http://www.acme.com/foo%2f%25/<<%0anewå/æøås bar=baz; path="/foo/"; version=1s^\$version=\"?1\"?sfoo=bars)http://www.acme.com/foo/%25/<<%0anewå/æøåuhttp://www.acme.com/ü(R0R—RRlRWR’tcompiletIR¯RR„(R	R—RR=R”t
version_re((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_url_encodingys		
csVddlm‰m‰tjƒdd}tj‰ˆˆdˆdtƒƒ}t|ddƒt|dd	ƒt|dd
ƒd|f}t	|dd
|ƒt	|dd|ƒt	|dd|ƒ‡‡‡fd†}||tƒ}|j
t|ƒdƒ|jdt
|ƒƒ||tƒ}|j
t|ƒdƒ|jdt
|ƒƒdS(Niÿÿÿÿ(RsRiiRœR™shttp://www.acme.com/s foo1=bar; max-age=100; Version=1s4foo2=bar; port="80"; max-age=100; Discard; Version=1sfoo3=bar; secure; Version=1sexpires=09-Nov-%d 23:12:40 GMTshttp://www.foo.com/sfooa=bar; %ssfoob=bar; Domain=.foo.com; %ss fooc=bar; Domain=www.foo.com; %scsiz<|jd|ƒˆˆˆdtƒƒ}|jd|ƒWdytjˆƒWntk
rcnXX|S(NRgR™(RkRlRmRnRoRp(RµRgtnew_c(RRsRq(s//usr/local/lib/python2.7/test/test_cookielib.pytsave_and_restore¨s
isname='foo1', value='bar'i(R0RsRRRRRhRlRWRXRR­R¯RR‚(R	R
R=R-RR((RRsRqs//usr/local/lib/python2.7/test/test_cookielib.pyttest_mozillas0				
			cCsáddlm}ddlm}|ƒ}g}|dƒ}|jdƒt|dƒ}|j||ƒ|jdƒt|dƒ}|j||ƒ|dƒ}|j|ƒ|jd|j	d	ƒkoÙd
|j	d	ƒkƒdS(Niÿÿÿÿ(R—(RYshttp://foo.bar.acme.com/foos4Set-Cookie: Customer=WILE_E_COYOTE; domain=.acme.comshttp://www.acme.com/foos4Set-Cookie: PART_NUMBER=3,4; domain=foo.bar.acme.comsPART_NUMBER=3,4RZsCustomer=WILE_E_COYOTE(
R0R—R[RYR^RJR_R\RR](R	R—RYR=RPRaRH((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_netscape_misc»s 	


cCs¦ddlm}m}||dtƒƒ}t|ddƒt|ddƒ}|jd|ƒt|ddƒt|dƒ}|jd	|ƒ|jt|ƒd
ƒdS(Niÿÿÿÿ(R—RR™shttp://example/s#foo1=bar; PORT; Discard; Version=1;s$foo2=bar; domain=".local"; Version=1sfoo1=barsfoo3=bar; Version=1sfoo2=bari(R0R—RRlRWR¯RR­(R	R—RR=R”((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_intranet_domains_2965Ös			cCs¬ddlm}m}||dtƒƒ}t|ddƒt|ddƒ}|jt|ƒdƒ|jd|ƒt|dƒ}|jd|ƒ|jt|ƒdƒdS(	Niÿÿÿÿ(R—RR™shttp://example/sfoo1=barsfoo2=bar; domain=.localisfoo2=bar(R0R—RR‚RXRR­R¯(R	R—RR=R”((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_intranet_domains_nsæs		cCsddlm}m}ddlm}||dtƒƒ}g}|dƒ}|jdƒt|dƒ}|j||ƒ|dƒ}|j	|ƒ|j
|jdƒdƒ|j
|jd	ƒd
ƒ|dƒ}|j	|ƒ|j
|jdƒdƒ|j
|jd	ƒd
ƒdS(Niÿÿÿÿ(R—R(RYR™shttp://www.ants.com/s,Set-Cookie: JSESSIONID=ABCDERANDOM123; Path=RZsJSESSIONID=ABCDERANDOM123Ræs$Version="1"shttp://www.ants.com:8080(R0R—RR[RYRlR^RJR_R\RR](R	R—RRYR=RPRaRH((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_empty_pathôs$	


cCs‡ddlm}ddlm}tjƒdd}|dƒ}g}|jdƒ|jd|ƒ|jd	|ƒ|jd
ƒ|jdƒt|dƒ}|ƒ}|j||ƒidd6dd
6dd6dd6}x-|D]%}	d|	j	}
||
d||
<qàW|j
ƒx-|D]%}	d|	j	}
||
d||
<qW|j|d
|dƒ|j|ddƒ|j|ddƒdS(Niÿÿÿÿ(R—(RYiis"http://www.perlmeister.com/scriptss$Set-Cookie: s1=session;Path=/scriptssWSet-Cookie: p1=perm; Domain=.perlmeister.com;Path=/;expires=Fri, 02-Feb-%d 23:24:20 GMTs>Set-Cookie: p2=perm;Path=/;expires=Fri, 02-Feb-%d 23:24:20 GMTs<Set-Cookie: s2=session;Path=/scripts;Domain=.perlmeister.coms2Set-Cookie2: s3=session;Version=1;Discard;Path="/"t
session_aftert
perm_aftertsession_beforetperm_befores	%s_befores%s_after(
R0R—R[RYRRR^RJR_RjR®RtassertNotEqual(R	R—RYR
RaRPRHR=tcounterR”tkey((s//usr/local/lib/python2.7/test/test_cookielib.pyttest_session_cookiess:
		

	






(R'R(RRRRRRRRR R!R"R*(((s//usr/local/lib/python2.7/test/test_cookielib.pyR
Ûs	^	6	r	8	]		+				"cCstjtttttƒdS(N(Rtrun_unittestRR)RRcR
(tverbose((s//usr/local/lib/python2.7/test/test_cookielib.pyt	test_mainDst__main__R,(t__doc__R0RnR’RRRRRtunittestRR!RRR)RJRWRXRTRcRR
R R-R'Rl(((s//usr/local/lib/python2.7/test/test_cookielib.pyt<module>s0"wr			+ÿÿÿœÿÿk	

Zerion Mini Shell 1.0