config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/test/test_wsgiref.pyc

hRc@sddklZddklZlZlZddklZddkl	Z	ddk
lZlZddk
lZddklZddklZlZlZdd	klZdd
klZddklZddkZddkZd
efdYZdefdYZdZeddZdZdefdYZ defdYZ!defdYZ"defdYZ#de#fdYZ$defd YZ%d!Z&e'd"joe&ndS(#i(t
nested_scopes(t	TestSuitetTestCaset	makeSuite(tsetup_testing_defaults(tHeaders(tBaseHandlertBaseCGIHandler(tutil(t	validator(t
WSGIServertWSGIRequestHandlertdemo_app(tmake_server(tStringIO(t
BaseServerNt
MockServercBs eZdZdZdZRS(sNon-socket HTTP servercCs!ti||||idS(N(Rt__init__tserver_bind(tselftserver_addresstRequestHandlerClass((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRscCs/|i\}}||_||_|idS(N(Rtserver_nametserver_portt
setup_environ(Rthosttport((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRs		(t__name__t
__module__t__doc__RR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRs	tMockHandlercBs eZdZdZdZRS(sNon-socket HTTP handlercCs%|i|_|i\|_|_dS(N(trequestt
connectiontrfiletwfile(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pytsetupscCsdS(N((R((s-/usr/local/lib/python2.5/test/test_wsgiref.pytfinish#s(RRRR#R$(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRs	cCs|dddgdgS(	Ns200 OKsContent-Types
text/plaintDatesMon, 05 Jun 2006 18:49:54 GMTs
Hello, world!(sContent-Types
text/plain(R%sMon, 05 Jun 2006 18:49:54 GMT((tenvirontstart_response((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt	hello_app*s
sGET / HTTP/1.0

cCstdd|tt}t|tttif\}}}}|t_z|i||fdWd|t_X|i|ifS(NtiPs	127.0.0.1i"(s	127.0.0.1i"(R
RRRtsyststderrtfinish_requesttgetvalue(tapptdatatservertinptoutterrtolderr((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt	run_amock1s-	
cCs%|}d}x3|D]+}|||jp
tn|d7}qWy||Wntj
onXtd|yttfWntj
onX|}t||j	o
tnx+|D]#}|i|jp
tqqWy|iWntj
onXtd|dS(sUtility to compare a generic 2.1/2.2+ iterator with an iterable

    If running under Python 2.2+, this tests the iterator using iter()/next(),
    as well as __getitem__.  'make_it' must be a function returning a fresh
    iterator to be tested (since this may test the iterator twice).iisToo many items from __getitem__sToo many items from .next()N(tAssertionErrort
IndexErrortitert
StopIterationt	NameErrortnext(tmake_ittmatchtittntitem((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcompare_generic_iterSs8	
	
tIntegrationTestscBs/eZedZdZdZdZRS(cCs?|i|dtiidd|odpdddS(Ns/HTTP/1.0 200 OK
Server: WSGIServer/0.1 Python/isA
Content-Type: text/plain
Date: Mon, 05 Jun 2006 18:49:54 GMT
sContent-Length: 13
R)s
Hello, world!(tassertEqualR*tversiontsplit(RR2t
has_length((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheck_hello~s	*cCs t\}}|i|dS(N(R5RG(RR2R3((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttest_plain_helloscCs/ttt\}}|i|dtdS(NRF(R5R	R(RGtFalse(RR2R3((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttest_validated_helloscCsUd}tt|\}}|i|id|i|idddS(NcSs|dddgS(Ns200 OKsContent-Types
text/plains
Hello, world!(sContent-Types
text/plain((R&R'((s-/usr/local/lib/python2.5/test/test_wsgiref.pytbad_apps
s;A server error occurred.  Please contact the administrator.is]AssertionError: Headers (('Content-Type', 'text/plain')) must be of type list: <type 'tuple'>(R5R	t
failUnlesstendswithRCt
splitlines(RRKR2R3((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttest_simple_validation_errors	

(RRtTrueRGRHRJRO(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRB|s		tUtilityTestscBseZdZddZdZdZddZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZRS(cCsjh|d<|d<}ti||iti|||i|d||i|d||S(NtSCRIPT_NAMEt	PATH_INFO(RRRCtshift_path_info(Rtsn_intpi_intparttsn_outtpi_outtenv((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt
checkShifts
cCsh}ti|t|to|it||tn|i|||h||<}ti||i|||jdS(N(RRt
isinstanceRRLRC(RtkeytvaluetaltRZ((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckDefaults

cKs%ti||i|||dS(N(RRRC(RR]R^tkw((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckCrossDefaults
cKs*ti||iti||dS(N(RRRCtapplication_uri(RturiRa((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckAppURIs
icKs-ti||iti|||dS(N(RRRCtrequest_uri(RRdtqueryRa((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckReqURIs
cCs}||d}t|||}|i|iix|D]}q?W|i|ii|i|i|iidS(NcSstit||S(N(RtFileWrapperR(ttexttsize((s-/usr/local/lib/python2.5/test/test_wsgiref.pyR<s(RAtfailIftfileliketclosedtcloseRL(RRjRkR=R<R>R@((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckFWs
	
cCs|iddddd|iddddd|iddddd|iddddd|idd	ddddS(
NR)t/s/xtxs/as/x/ys/a/xs/ys/x/(R[tNone(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestSimpleShiftss
cCs|iddddd|iddddd|idddd	d|idd
dd	d|idddd	d|idd
dd	d|iddddd|iddddd|iddddd|iddddd|iddddddS(Ns/a/bs/../ys..s/as/yR)s//ytys/a/b/ys//y/Rqs/./ys/./y/s///./..//y/.//s/y/s///s/a/b/s/.//s/x//Rrs/a/b/xs/.(R[Rs(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestNormalizedShiftsscCspxidddddddddfd d!d"dtdfdtfd#gD]\}}|i||qLWdS($NtSERVER_NAMEs	127.0.0.1tSERVER_PORTt80tSERVER_PROTOCOLsHTTP/1.0t	HTTP_HOSTtREQUEST_METHODtGETRRR)RSRqswsgi.versioniis
wsgi.run_onceswsgi.multithreadswsgi.multiprocesss
wsgi.inputswsgi.errorsswsgi.url_schemethttp(sSERVER_NAMEs	127.0.0.1(sSERVER_PORTRy(sSERVER_PROTOCOLsHTTP/1.0(s	HTTP_HOSTs	127.0.0.1(R|R}(sSCRIPT_NAMER)(s	PATH_INFORq(ii(s
wsgi.run_oncei(swsgi.multithreadi(swsgi.multiprocessi(swsgi.url_schemeR~(RR`(RR]R^((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestDefaultss"	cCs|idddd|idddd|idddd|idddd	|idd
dd|idd
dd|idddddS(NR{sfoo.barRwswsgi.url_schemethttpstHTTPStont1tyesR~tfooRxRyt443(Rb(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestCrossDefaultsscCs|itihd|itihdd<d|itihdd<d|itihdd<d|itihdd<ddS(NR~RRRRRR(RCRtguess_scheme(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestGuessSchemes
"""cCs|id|iddd|iddddd	|id
dd|iddd
dd|iddd|iddddddS(Nshttp://127.0.0.1/shttp://127.0.0.1/spamRRs/spamshttp://spam.example.com:2071/R{sspam.example.com:2071Rxt2071shttp://spam.example.com/Rwsspam.example.coms	127.0.0.1shttps://127.0.0.1/RRshttp://127.0.0.1:8000/t8000(ReRs(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestAppURIs s


c	Cs~|id|iddd|iddddd|idddddd	d
|iddddddd	d
dS(Nshttp://127.0.0.1/shttp://127.0.0.1/spamRRs/spamshttp://127.0.0.1/spammity/spams	/spammityRSs%http://127.0.0.1/spammity/spam?say=nitQUERY_STRINGssay=nii(Rh(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestReqURIs-s

cCs)|idddddddgdS(Ntxyzi2ixi(i
(Rp(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestFileWrapper7scCsxYdiD]K}xB||i|i|ifD]}|iti|q8Wq
WxYdiD]K}xB||i|i|ifD]}|iti|qWqiWdS(NsbConnection Keep-Alive Proxy-Authenticate Proxy-Authorization TE Trailers Transfer-Encoding Upgrades4Accept Cache-Control Date Pragma Trailer Via Warning(REttitletuppertlowerRLRt
is_hop_by_hopRl(RthopR_((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestHopByHop:s
%
%N(RRR[RsR`RbReRhRpRtRvRRRRRRR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRQs									
		
	
	tHeaderTestscBs#eZdZdZdZRS(c
Cs@dg}|ittgd|itt|d|it|idg|it|idg|it|i||it|i|jtg}|d=d|d<xx|i|i|i	|i
|ifD]R}|i|d|i|d|i|d|i|dqW|i|ddd	|d<|i|dd	|i|i
dd	g|i|i	dd
d	|i|i	dd
d
|i|i
dd
d	|i|i
dd
d
|i|dd	|i|dd
dS(
NRrRuiiRtbartFootFOOtbaztwheetzoo(RrRu(RCtlenRtkeystvaluestitemsRlthas_keyt__contains__tgettget_allt__getitem__RLt
setdefault(Rttestthtm((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestMappingInterfaceKs4	  
%
cCs|ittddS(NR(tassertRaisest	TypeErrorR(R((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestRequireListjscCstg}|it|d|idddd|i|dd|it|d|iddd	d|i|iddd
g|it|ddS(Ns
RRRtspamsbar; baz="spam"sfoo: bar; baz="spam"

Rtcheesesbar; cheeses*foo: bar; baz="spam"
Foo: bar; cheese

(RRCtstrt
add_headerRsR(RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt
testExtrasns
(RRRRR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRIs		tErrorHandlercBseZdZdZRS(s/Simple handler subclass for testing BaseHandlerc
Ks?t|ti|tdtt|dtdtdS(NR)tmultithreadtmultiprocess(RRRRRP(RRa((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRs
(RRRR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRstTestHandlercBseZdZdZRS(sASimple handler subclass for testing BaseHandler, w/error passthrucCsdS(N((R((s-/usr/local/lib/python2.5/test/test_wsgiref.pythandle_errors(RRRR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRstHandlerTestscBsbeZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
cCsv|i}xfdddddgD]O}|djo|idjoqn|it|d||d|qWdS(NRDRRtrun_oncetfile_wrappertwsgi_swsgi.(R&twsgi_file_wrapperRsRCtgetattr(RthandlerRZtattr((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckEnvironAttrss	cCsh}t||i}ddkl}xB|iD]4\}}|i|p|i|||q6q6Wx0|iD]"\}}|i|i|q{WdS(Ni(R&(RR&tosRRRCRL(RRtemptyRZR&tktv((s-/usr/local/lib/python2.5/test/test_wsgiref.pytcheckOSEnvirons
	

cCsNtdd}|i|i||i||i|idddS(NtXtY(RRRRRCR&(RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestEnvirons



cCsMtdddh}|ix'dD]}|i|ii|q&WdS(Nswsgi.url_schemes
wsgi.inputswsgi.errors(swsgi.url_schemes
wsgi.inputswsgi.errors(RRsRtassert_R&R(RRR]((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestCGIEnvirons

cCs^tdd}|i|i|iddt}|i|i|idddS(NRRswsgi.url_schemeRR~(RRRCR&(RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt
testSchemes
	
cCsYt}x3ddddgD]}|itt||qW|it|iddS(Nt_flusht	get_stdint
get_stderrtadd_cgi_varsR(RRtNotImplementedErrorRt_write(RRtname((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestAbstractMethodss	cCstd}d}t}|i||i|iidt}|i||i|iiddS(NcSs|dg|dgS(Ns200 OKswsgi.url_scheme((tets((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttrivial_app1s
cSs|dg|dgS(Ns200 OKswsgi.url_scheme((RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttrivial_app2ss)Status: 200 OK
Content-Length: 4

httpsStatus: 200 OK

http(RtrunRCtstdoutR-(RRRR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestContentLengths			
	
cCsd}d}t}|i||i|iid|i|iidt}|i||i|iid|it|i|if|i	|iii
ddjdS(NcSs|dggS(Ns200 OK((RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt
non_error_apps
cSstddS(Ns This should be caught by handler(R6(RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt	error_appss%Status: 200 OK
Content-Length: 0

R)s>Status: %s
Content-Type: text/plain
Content-Length: %d

%sR6i(RRRCRR-R+terror_statusRt
error_bodyRLtfind(RRRR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestBasicErrorOutputs			
	
 csqdfd}t}|i||i|iid|i|iiiddjdS(NsSome output has been sentcs#|dgtddS(Ns200 OKs This should be caught by handler(R6(RR(tMSG(s-/usr/local/lib/python2.5/test/test_wsgiref.pyR
ssStatus: 200 OK

R6i(RRRCRR-RLR+R(RRR((Rs-/usr/local/lib/python2.5/test/test_wsgiref.pyttestErrorAfterOutputs	
c	Cs]d}d}d}xAd
D]9}|od|pd}xdD]}xdD]}td|}t|_||_||_|i||i||ii	td|}t
|_||_||_|i||d	jo|i|ii	dqN|iti
|||f|ii	|||f|ii	fqNWqAWqWdS(NcSs|dggS(Ns200 OK((RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRs
sfHTTP/%s 200 OK\r\nDate: \w{3}, [ 0123]\d \w{3} \d{4} \d\d:\d\d:\d\d GMT\r\n%sContent-Length: 0\r\n\r\ns%Status: 200 OK
Content-Length: 0

s
FooBar/1.0sServer: %s
R)s1.0s1.1sHTTP/0.9sHTTP/1.0sHTTP/1.1Rz(s
FooBar/1.0N(s1.0s1.1(sHTTP/0.9sHTTP/1.0sHTTP/1.1(RsRRIt
origin_serverthttp_versiontserver_softwareRRCRR-RPRLtreR=(	RRtstdpattshortpattsswtswRDtprotoR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyttestHeaderFormatss4				
			

"(RRRRRRRRRRRR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pyRs			
						 		cCs=ddk}ddkl}||iititdS(Ni(t	run_suite(tunittestttest.test_supportRtdefaultTestLoadertloadTestsFromModuleR*tmodulesR(RR((s-/usr/local/lib/python2.5/test/test_wsgiref.pyt	test_mainAst__main__((t
__future__RRRRRtwsgiref.utilRtwsgiref.headersRtwsgiref.handlersRRtwsgirefRtwsgiref.validateR	twsgiref.simple_serverR
RRR
RtSocketServerRRR*RRR(R5RARBRQRRRRRR(((s-/usr/local/lib/python2.5/test/test_wsgiref.pys<module>s2
	"	))8
	


Man Man