File: test_exc.pyc

package info (click to toggle)
python-webob 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,340 kB
  • ctags: 2,468
  • sloc: python: 13,433; makefile: 12
file content (104 lines) | stat: -rw-r--r-- 16,243 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

tSc
@sddklZddklZddklZddklZddklZddklZddkl	Z	ddkl
Z
dd	klZdd
klZddk
lZlZlZlZedZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,S(-i(tRequest(twsgify(t	no_escape(t
strip_tags(t
HTTPException(tWSGIHTTPException(t	_HTTPMove(tHTTPMethodNotAllowed(tHTTPExceptionMiddleware(t
status_map(teq_tok_tassert_equalt
assert_raisescCs!|idjo
tndS(NtGETshello!(tmethodR(treq((s-/home/chrism/projects/webob/tests/test_exc.pytmethod_not_allowed_apps
cCsttdddS(Nt(RRtNone(((s-/home/chrism/projects/webob/tests/test_exc.pyttest_noescape_nullscCsttdddS(Ni*t42(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyttest_noescape_not_basestringscCs6dtfdY}|}tt|ddS(NtDummyUnicodeObjectcBseZdZRS(cSsdS(NR((tself((s-/home/chrism/projects/webob/tests/test_exc.pyt__unicode__s(t__name__t
__module__R(((s-/home/chrism/projects/webob/tests/test_exc.pyRsR(tobjectRR(Rtduo((s-/home/chrism/projects/webob/tests/test_exc.pyttest_noescape_unicodes	cCsttdddS(NR(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyttest_strip_tags_empty!scCsttdddS(Nsa
bsa b(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyt test_strip_tags_newline_to_space$scCsttdddS(Nsa
btab(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyt$test_strip_tags_zaps_carriage_return'scCsttdddS(Nsa<br/>bsa
b(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyttest_strip_tags_br_to_newline*scCsttdddS(Ns	a<!--b-->R!(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyttest_strip_tags_zaps_comments-scCsttdddS(Nsfoo<bar>baz</bar>tfoobaz(RR(((s-/home/chrism/projects/webob/tests/test_exc.pyttest_strip_tags_zaps_tags0scsddk}gtfd}h}t}td|}t|i|j|||}t||jt||fgdS(Nicsi||fS(N(tappend(tenvirontstart_response(t_resultt_called(s-/home/chrism/projects/webob/tests/test_exc.pyt	_response7sttesting(twarningsRRRt
wsgi_responseR(R.R,R(R)texctresult((R*R+s-/home/chrism/projects/webob/tests/test_exc.pyttest_HTTPException3s		cCs?tiddd}|it}|idjptdS(Nt/RtPOSTi(Rtblanktget_responseRtstatus_codetAssertionError(Rtres((s-/home/chrism/projects/webob/tests/test_exc.pyt test_exception_with_unicode_dataBscCsFtdddg}|ii}|dddgjptdS(Ntheaderss
Set-Cookiesa=1sa=2s
set-cookie(s
Set-Cookiesa=1(s
Set-Cookiesa=2(RR;tmixedR8(R0R<((s-/home/chrism/projects/webob/tests/test_exc.pyttest_WSGIHTTPException_headersGs	cCsvddkl}d}td|}t|i|tt|i|t|ii	hdd6dd6d	dS(
Ni(tTemplates
$foo: $bart
body_templatetFOOtfootBARtbarsFOO: BAR(
tstringR>RRR?Rt
isinstancetbody_template_objR
t
substitute(R>tTEMPLATER0((s-/home/chrism/projects/webob/tests/test_exc.pyt&test_WSGIHTTPException_w_body_templateMs cCsUdtfdY}|dddd}td|ijtd|ijdS(Nt	EmptyOnlycBseZeZRS((RRtTruet
empty_body(((s-/home/chrism/projects/webob/tests/test_exc.pyRJWstcontent_types
text/plaintcontent_lengthi(RRt__dict__(RJR0((s-/home/chrism/projects/webob/tests/test_exc.pyt#test_WSGIHTTPException_w_empty_bodyVscCsRtdd}tt|ddtfdY}tt|ddS(NtdetailtDetailtExplaincBseZdZRS(tExplanation(RRtexplanation(((s-/home/chrism/projects/webob/tests/test_exc.pyRS`sRT(RR
tstr(texc1RS((s-/home/chrism/projects/webob/tests/test_exc.pyttest_WSGIHTTPException___str__]scCs?dtfdY}|dd}t|ihddS(NRScBseZdZdZdZRS(t999tTestingRT(RRtcodettitleRU(((s-/home/chrism/projects/webob/tests/test_exc.pyRSesRQRRs#999 Testing

Explanation

 Detail  (RR
t
plain_body(RSR0((s-/home/chrism/projects/webob/tests/test_exc.pyt,test_WSGIHTTPException_plain_body_no_commentdscCsEdtfdY}|dddd}t|ihddS(NRScBseZdZdZdZRS(RYRZRT(RRR[R\RU(((s-/home/chrism/projects/webob/tests/test_exc.pyRSnsRQRRtcommenttComments<html>
 <head>
  <title>999 Testing</title>
 </head>
 <body>
  <h1>999 Testing</h1>
  Explanation<br /><br />
Detail
<!-- Comment -->

 </body>
</html>(RR
t	html_body(RSR0((s-/home/chrism/projects/webob/tests/test_exc.pyt*test_WSGIHTTPException_html_body_w_commentmscCs[dd}hdd6dd6dd6dd	6d
d6}t}t|||dgdS(
NcSsdS(N((tstatusR;texc_info((s-/home/chrism/projects/webob/tests/test_exc.pyR)stHTTPswsgi.url_schemet	localhosttSERVER_NAMEt80tSERVER_PORTtPUTtREQUEST_METHODs	text/htmltHTTP_ACCEPTsr<html>
 <head>
  <title>None None</title>
 </head>
 <body>
  <h1>None None</h1>
  <br /><br />



 </body>
</html>(RRR(R)R(texcep((s-/home/chrism/projects/webob/tests/test_exc.pyt(test_WSGIHTTPException_generate_responses
	cCs]dd}hdd6dd6dd6dd	6}t}d
|_t|||d
gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRiRjRkttest(RRtbodyR(R)R(Rm((s-/home/chrism/projects/webob/tests/test_exc.pyt"test_WSGIHTTPException_call_w_bodys
		cCsTdd}hdd6dd6dd6dd	6}t}t|i||gdS(
NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRitHEADRk(RRRR/(R)R(Rm((s-/home/chrism/projects/webob/tests/test_exc.pyt$test_WSGIHTTPException_wsgi_responses
	cCsjdd}hdd6dd6dd6dd	6}t}d
dkl}t|_t|||gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRiRrRki(R0(RRtwebobR0RKtnewstyle_exceptionsR(R)R(RmR0((s-/home/chrism/projects/webob/tests/test_exc.pyt)test_WSGIHTTPException_exception_newstyles
		cCsjdd}hdd6dd6dd6dd	6}t}d
dkl}t|_t|||gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRiRrRki(R0(RRRtR0tFalseRuR(R)R(RmR0((s-/home/chrism/projects/webob/tests/test_exc.pyt,test_WSGIHTTPException_exception_no_newstyles
		csddfd}fd}tiddd}|i|}||dt|id	|}|i|_|i|_||d
|i|}||ddS(NsHi!
sapplication/hellocsRd}dfdtfg}||||ddjogSgSdS(s+An application object that understands HEADs200 OKsContent-TypesContent-LengthRkRrN(tlen(R(R)Rctresponse_headers(tCONTENT_TYPEtHELLO_WORLD(s-/home/chrism/projects/webob/tests/test_exc.pythead_apps	
csCt|i|t|it|t|id|dS(NR(RRMRNRyRp(tresptdescription(R{R|(s-/home/chrism/projects/webob/tests/test_exc.pytverify_responsesR3RRrsfirst responsetrequestscopied responsesevaluated copy(RR5R6R	t
status_intRpt
headerlist(R}RRtresp1tresp2tresp3((R{R|s-/home/chrism/projects/webob/tests/test_exc.pyt test_HTTPOk_head_of_proxied_heads

cCsXdd}hdd6dd6dd6dd	6d
d6}t}t|||gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRiRrRkR3t	PATH_INFO(RRR(R)R(tm((s-/home/chrism/projects/webob/tests/test_exc.pyt
test_HTTPMoves
	cCs^dd}hdd6dd6dd6dd	6d
d6}tdd
}t|||gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRiRrRkR3Rtlocationshttp://example.com(RRR(R)R(R((s-/home/chrism/projects/webob/tests/test_exc.pyttest_HTTPMove_location_not_nones
cCs)dd}tttdddtdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sRshttp://example.comt	add_slash(RR
t	TypeErrorRRK(R)((s-/home/chrism/projects/webob/tests/test_exc.pyt$test_HTTPMove_add_slash_and_locationscCsadd}hdd6dd6dd6dd	6d
d6}t}t|_t|||gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)sReswsgi.url_schemeRfRgRhRiRrRkR3R(RRRKRR(R)R(R((s-/home/chrism/projects/webob/tests/test_exc.pyttest_HTTPMove_call_add_slashs
		cCsndd}hdd6dd6dd6dd	6}t}t|_d
|d<d|d
<t|||gdS(NcSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)$sReswsgi.url_schemeRfRgRhRiRrRktquerystringtQUERY_STRINGR3R(RRRKRR(R)R(R((s-/home/chrism/projects/webob/tests/test_exc.pyttest_HTTPMove_call_query_string#s
		

cCsGd}|}t|}h}d}|||}t|ddS(NcSsdS(Nt123((R(R)((s-/home/chrism/projects/webob/tests/test_exc.pytapp3sR(RRR(RtapplicationRR(R)R9((s-/home/chrism/projects/webob/tests/test_exc.pyttest_HTTPExceptionMiddleware_ok2s	csVdfd}|}t|}h}d}|||}t|ddS(NcSsdS(NR((R(R)((s-/home/chrism/projects/webob/tests/test_exc.pyR/=scstddS(N(RR(R(R)(R/(s-/home/chrism/projects/webob/tests/test_exc.pyR?sR(RRR(RRRR(R)R9((R/s-/home/chrism/projects/webob/tests/test_exc.pyt&test_HTTPExceptionMiddleware_exception<s	c
sdddY}dfd}|}t|}h}d}zBddkl}|i}|}|||}	t|	dWd||_XdS(	NtDummySyscBseZdZRS(cSsdS(N(R(R((s-/home/chrism/projects/webob/tests/test_exc.pyRdJs(RRRd(((s-/home/chrism/projects/webob/tests/test_exc.pyRIscSs|dgddS(Ns200 OKRd(R(R(R)((s-/home/chrism/projects/webob/tests/test_exc.pyR/LscstddS(N(RR(R(R)(R/(s-/home/chrism/projects/webob/tests/test_exc.pyRNscSsdS(N((RcR;Rd((s-/home/chrism/projects/webob/tests/test_exc.pyR)Ssi(R0((RRtR0tsysRR(
RRRRR(R)R0told_sysRR9((R/s-/home/chrism/projects/webob/tests/test_exc.pyt4test_HTTPExceptionMiddleware_exception_exc_info_noneHs				N(2t
webob.requestRt	webob.decRt	webob.excRRRRRRRR	t
nose.toolsR
RRR
RRRRRR R"R#R$R&R2R:R=RIRPRXR^RbRnRqRsRvRxRRRRRRRRR(((s-/home/chrism/projects/webob/tests/test_exc.pyt<module>sT"																									%