File: test_dec.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 (69 lines) | stat: -rw-r--r-- 12,242 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

\Qc
@sddkZddklZddklZddklZddklZddkl	Z	ddkl
Z
deifd	YZdS(
iN(tRequest(tResponse(twsgify(tbytes_(ttext_(tPY3tDecoratorTestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZRS(cCs6t|toti|}n|i|}|S(N(t
isinstancetstrRtblanktget_response(tselftapptreqtresp((s-/home/chrism/projects/webob/tests/test_dec.pyt_testit
scsdtfd}|i|d}|i|itd|i|id|i|id|i|iddS(Nshey, this is a test: %scst|iS(N(Rturl(R
(tresp_str(s-/home/chrism/projects/webob/tests/test_dec.pyttest_appss/a urlshttp://localhost/a%20urli-s	text/htmlsUTF-8(RRtassertEqualtbodyRtcontent_lengthtcontent_typetcharset(RRR((Rs-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgifyscCs |idttjdS(Ns	wsgify at(t
assertTruetreprR(R((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_empty_reprscCsd}td|fd}|i|d}|i|i||i|id|i|id|i|iddS(Ns
hey hey my mytargscSs|S(N((R
tstrarg((s-/home/chrism/projects/webob/tests/test_dec.pyR!ss/a urli
s	text/htmlsUTF-8(RRRRRRR(RRRR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_argsscCsd}tdtd|dd}|i|d}|i|i||i|id|i|id|i|id	dS(
Ns
hey hey my mytkwargsRtcSs|S(N((R
R((s-/home/chrism/projects/webob/tests/test_dec.pyR,ss/a urli
s	text/htmlsUTF-8(RtdictRRRRRR(RRRR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_kwargs*scszddkltfd}|i|d}|i|iid|i|id|i|i	ddS(Ni(tHTTPBadRequestcs
dS(N((R
(R#(s-/home/chrism/projects/webob/tests/test_dec.pyR7ss/a urls400 Bad Requests
text/plainsUTF-8(
t	webob.excR#RRRRt
startswithRRR(RRR((R#s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_raise_httpexception5scCsjdtfdY}t|}|i|d}|i|id|i|i||jdS(NtTestAppcBseZdZRS(cSsdS(Nsnothing to see here((RR
((s-/home/chrism/projects/webob/tests/test_dec.pyt__call__Cs(t__name__t
__module__R((((s-/home/chrism/projects/webob/tests/test_dec.pyR'Bss/a urlsnothing to see here(tobjectRRRRRt__get__(RR'RR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_no___get__?s
cCs>d}t|}|i|d}|i|iddS(NcSs
tdS(Ns	some text(R(R
((s-/home/chrism/projects/webob/tests/test_dec.pyRKss/a urls	some text(RRRR(RRR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_app_returns_unicodeJs	cCs/tddd}|it|i|ddS(NRis/a url(i(RtNonetassertRaisest	TypeErrorR(RR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_args_no_funcQscCsQtd}t}|it||dd|it||ddddS(NcSsdS(Ns!What have you done for me lately?((R
((s-/home/chrism/projects/webob/tests/test_dec.pyRVsiitkeytword(RR!R0R1(RRR
((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_wrong_sigUs	cCs^td}|i|d}|i|id|i|id|i|iddS(NcSsdS(N((R
((s-/home/chrism/projects/webob/tests/test_dec.pyR^ss/a urlR s	text/htmli(RRRRRR(RRR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_none_response]s
csAdtfd}|id}|i|idS(Ns What'choo talkin' about, Willis?cs
tS(N(R(R
(R(s-/home/chrism/projects/webob/tests/test_dec.pyRhss	/url/path(RtgetRR(RRR((Rs-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_getfscCsetdddd}td}|id|}|i|itd|d|dfdS(NtspeakertRobintwordssHoly test coverage, Batman!cSs"td|id|idfS(Ns%s: %sR9R;(RtPOST(R
((s-/home/chrism/projects/webob/tests/test_dec.pyRqss	/url/paths%s: %s(R!RtpostRRR(Rt	post_dictRR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_postns	cssd}tfd}|idddd|}i|i|i|idi|iddS(	Ns
Nice body!cs i|idt|iS(NtPUT(RtmethodRR(R
(R(s-/home/chrism/projects/webob/tests/test_dec.pyR{ss	/url/pathRAR@Ri
s	text/html(RtrequestRRRR(RRRR((Rs-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_request_methodys	cCs/d}t|}|i|i|jdS(NcSs
tdS(Ntwhoa(R(R
((s-/home/chrism/projects/webob/tests/test_dec.pyRs(RRtundecorated(RRtwrapped_test_app((s-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_undecorateds	csddtfdY}td|fd}|i|d}|i|itd|i|id|i|id	|i|id
dS(Nshey, this is a test: %st	MyRequestcBseZRS((R)R*(((s-/home/chrism/projects/webob/tests/test_dec.pyRHstRequestClasscst|iS(N(RR(R
(R(s-/home/chrism/projects/webob/tests/test_dec.pyRss/a urlshttp://localhost/a%20urli-s	text/htmlsUTF-8(	RRRRRRRRR(RRHRR((Rs-/home/chrism/projects/webob/tests/test_dec.pyttest_wsgify_custom_requestscsdtid}ddkl}|i|i|jt|}|id|jtfd}||ddd	d
}|i|d}|i|i	t
d|i|id
|i|id|i|i
ddS(NsThese are the vars: %sc[s|ii|||S(N(turlvarstupdate(R
Rtvars((s-/home/chrism/projects/webob/tests/test_dec.pyt
set_urlvarsi(t_MiddlewareFactoryRNcst|iiS(N(tsortedRKtitems(R
(R(s-/home/chrism/projects/webob/tests/test_dec.pyt	show_varsstaitbis/paths[('a', 1), ('b', 2)]s	text/htmlsUTF-8i((Rt
middlewaret	webob.decRORt	__class__RRRRRRRR(RRNROtrRRt
show_vars2R((Rs-/home/chrism/projects/webob/tests/test_dec.pyttest_middlewarescCstd}tid|dd}ddkl}|i|i|j|i|it	dd|d}|i|itj|idt
|jdS(NcSs
tdS(Ns	Say wha!?(R(R
((s-/home/chrism/projects/webob/tests/test_dec.pyRstsometthingi(t_UnboundMiddlewarec[s
||S(N((R
Rtkw((s-/home/chrism/projects/webob/tests/test_dec.pytmiddlesR(RRUR/RVR]RRWRR^R!R(RRtunboundR]R_((s-/home/chrism/projects/webob/tests/test_dec.pyttest_unbound_middlewarescCsRtidd}ddkl}|i|i|j|i|it	dS(Ni(R](
RRUR/RVR]RRWRR^R!(RR`R]((s-/home/chrism/projects/webob/tests/test_dec.pyttest_unbound_middleware_no_appscCsdtfdY}|}td|d<td|d<tidit|}|i|id|i|id	|i|i	d
|i|i
ddS(NtHostMapcBseZedZRS(cSs||iiddS(Nt:i(thosttsplit(RR
((s-/home/chrism/projects/webob/tests/test_dec.pyR(s(R)R*RR((((s-/home/chrism/projects/webob/tests/test_dec.pyRcst1sexample.comt2s	other.comshttp://example.com/s	text/htmlsUTF-8i(R!RRR	R
RRRRRR(RRcRR((s-/home/chrism/projects/webob/tests/test_dec.pyt
test_classapps	cCsDtid}|t}|i|tidddS(NcSsdS(Ntfoo((R
R((s-/home/chrism/projects/webob/tests/test_dec.pytmwst/Rj(RRURRRR	(RRkR((s-/home/chrism/projects/webob/tests/test_dec.pyttest_middleware_direct_calls(R)R*RRRRR"R&R-R.R2R5R6R8R?RCRGRJRZRaRbRiRm(((s-/home/chrism/projects/webob/tests/test_dec.pyR	s*						
															(
tunittestt
webob.requestRtwebob.responseRRVRtwebob.compatRRRtTestCaseR(((s-/home/chrism/projects/webob/tests/test_dec.pyt<module>s