/opt/alt/python37/lib/python3.7/site-packages/paste
NameSizeModeActions
auth/-0755rm
cowbell/-0755rm
debug/-0755rm
evalexception/-0755rm
exceptions/-0755rm
util/-0755rm
__pycache__/-0755rm
cascade.py45080644editdlrm
cascade.pyc44750644editdlrm
cascade.pyo44750644editdlrm
cgiapp.py95900644editdlrm
cgiapp.pyc85540644editdlrm
cgiapp.pyo83370644editdlrm
cgitb_catcher.py37520644editdlrm
cgitb_catcher.pyc38510644editdlrm
cgitb_catcher.pyo38510644editdlrm
config.py43120644editdlrm
config.pyc52840644editdlrm
config.pyo52840644editdlrm
errordocument.py137770644editdlrm
errordocument.pyc130800644editdlrm
errordocument.pyo130800644editdlrm
fileapp.py136080644editdlrm
fileapp.pyc133520644editdlrm
fileapp.pyo132180644editdlrm
fixture.py579920644editdlrm
fixture.py.stdlib580750644editdlrm
fixture.pyc607260644editdlrm
fixture.pyo584530644editdlrm
flup_session.py39410644editdlrm
flup_session.pyc39590644editdlrm
flup_session.pyo39590644editdlrm
gzipper.py36920644editdlrm
gzipper.pyc45780644editdlrm
gzipper.pyo45780644editdlrm
httpexceptions.py242220644editdlrm
httpexceptions.pyc283800644editdlrm
httpexceptions.pyo276230644editdlrm
httpheaders.py430900644editdlrm
httpheaders.pyc452740644editdlrm
httpheaders.pyo439740644editdlrm
httpserver.py556620644editdlrm
httpserver.pyc486610644editdlrm
httpserver.pyo479990644editdlrm
lint.py149990644editdlrm
lint.pyc178890644editdlrm
lint.pyo137720644editdlrm
modpython.py79760644editdlrm
modpython.pyc89530644editdlrm
modpython.pyo89530644editdlrm
pony.py22790644editdlrm
pony.pyc27530644editdlrm
pony.pyo27530644editdlrm
progress.py81620644editdlrm
progress.pyc94160644editdlrm
progress.pyo94160644editdlrm
proxy.py101810644editdlrm
proxy.pyc87870644editdlrm
proxy.pyo87870644editdlrm
recursive.py146640644editdlrm
recursive.pyc181410644editdlrm
recursive.pyo178160644editdlrm
registry.py221930644editdlrm
registry.pyc229410644editdlrm
registry.pyo229410644editdlrm
reloader.py60100644editdlrm
reloader.pyc61340644editdlrm
reloader.pyo61340644editdlrm
request.py141450644editdlrm
request.pyc140650644editdlrm
request.pyo139690644editdlrm
response.py76590644editdlrm
response.pyc94680644editdlrm
response.pyo93840644editdlrm
session.py113350644editdlrm
session.pyc120530644editdlrm
session.pyo120530644editdlrm
transaction.py43620644editdlrm
transaction.pyc58570644editdlrm
transaction.pyo58570644editdlrm
translogger.py48120644editdlrm
translogger.pyc43740644editdlrm
translogger.pyo43740644editdlrm
url.py146240644editdlrm
url.pyc185810644editdlrm
url.pyo185810644editdlrm
urlmap.py90320644editdlrm
urlmap.pyc97730644editdlrm
urlmap.pyo96250644editdlrm
urlparser.py264240644editdlrm
urlparser.pyc226700644editdlrm
urlparser.pyo224940644editdlrm
wsgilib.py201340644editdlrm
wsgilib.pyc222360644editdlrm
wsgilib.pyo221800644editdlrm
wsgiwrappers.py221650644editdlrm
wsgiwrappers.pyc244500644editdlrm
wsgiwrappers.pyo244500644editdlrm
Edit: /opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyc (60726B)
Z]c@sdZddkZddkZddkZddkZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk l Z yddklZWn#ej oddklZnXddkZddkZddklZddklZddklZdZd efd YZd Zd efd YZdefdYZdefdYZdefdYZ defdYZ!defdYZ"defdYZ#ei$dei%Z&dZ'defdYZ(de(fdYZ)e)e(i*d Z8d?Z9e5d@Z:dAZ;dS(Bs Routines for testing WSGI applications. Most interesting is the `TestApp `_ for testing WSGI applications, and the `TestFileEnvironment `_ class for testing the effects of command-line scripts. iN(t BaseCookie(tStringIO(twsgilib(tlint(t HeaderDictcGs ti|S(s An os.tempnam with the warning turned off, because sometimes you just need to use this and don't care about the stupid security warning. (tosttempnam(targs((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyttempnam_no_warning#st NoDefaultcBseZRS((t__name__t __module__(((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyR +scCst|}|i|S(N(tlisttsort(tl((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytsorted.s  t Dummy_smtplibcBsGeZdZdZdZdZdZeeZdZ RS(cCsVddk}|idtd|i p td||_t|_||i_dS(Nis1Dummy_smtplib is not maintained and is deprecatedisIsmtplib.SMTP() called again before Dummy_smtplib.existing.reset() called.( twarningstwarntDeprecationWarningtexistingtAssertionErrortservertTruetopent __class__(tselfRR((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyt__init__7s    cCs%|iptd|t|_dS(NsCalled %s.quit() twice(RRtFalse(R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytquitCs  cCs||_||_||_dS(N(t from_addresst to_addressestmessage(RRRtmsg((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytsendmailHs  cCs |t_dS(N(tsmtplibtSMTP(tcls((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytinstallMscCs%|i p tdd|i_dS(NsSMTP connection not quit(RRtNoneRR(R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytresetRsN( R R R'RRRR"R&t classmethodR((((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyR3s    tAppErrorcBseZRS((R R (((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyR*WstTestAppcBseZeZddddddZdZdZddddedZ dddddedZ dddddedZ dddddedZ ddddedZ d Zd Zd Zd Zd ZdZdZRS(cCst|ttfo&ddkl}||d|}n||_||_||_|djo h}n||_ ||_ ||_ |i dS(s} Wraps a WSGI application in a more convenient interface for testing. ``app`` may be an application, or a Paste Deploy app URI, like ``'config:filename.ini#test'``. ``namespace`` is a dictionary that will be written to (if provided). This can be used with doctest or some other system, and the variable ``res`` will be assigned everytime you make a request (instead of returning the request). ``relative_to`` is a directory, and filenames used for file uploads are calculated relative to this. Also ``config:`` URIs that aren't absolute. ``extra_environ`` is a dictionary of values that should go into the environment for each request. These can provide a communication channel with the application. ``pre_request_hook`` is a function to be called prior to making requests (such as ``post`` or ``get``). This function must take one argument (the instance of the TestApp). ``post_request_hook`` is a function, similar to ``pre_request_hook``, to be called after requests are made. i(tloadappt relative_toN( t isinstancetstrtunicodet paste.deployR,tappt namespaceR-R't extra_environtpre_request_hooktpost_request_hookR((RR2R3R-R4R5R6R,((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyR_s        cCs h|_dS(sc Resets the state of the application; currently just clears saved cookies. N(tcookies(R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyR(scCs|ii}t|d<|S(Nspaste.throw_errors(R4tcopyR(Rtenviron((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyt _make_environs c Cs|djo h}nt}|obt|ttfpti|dt}nd|jo|d7}n |d7}||7}n|i}t|}d|jo |idd\}|d`_ tdoseqt?t&it QUERY_STRINGttstatusN( R'RR.R/R0turllibt urlencodeR:tsplitt _set_headerstupdatet TestRequestt do_request( RturltparamstheadersR4R@t expect_errorst__tracebackhide__R9treq((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytgets&          R?c Cs|d jo h}n|d jo h}n|i} t|tttfoti|}nt|doti|i }n|o;t i |dt }|i ||\} }| | dR?tCONTENT_LENGTHtREQUEST_METHODs wsgi.inputR@N(R'R:R.R ttupletdictRARBthasattrROtcgit parse_qslRtencode_multipartt setdefaultRCR/tlenRRDRERFRG( RtmethodRHRIRJR4R@t upload_filesRKR9t content_typeRM((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyt _gen_requests4          cCs4|id|d|d|d|d|d|d|S(s Do a POST request. Very like the ``.get()`` method. ``params`` are put in the body of the request. ``upload_files`` is for file uploads. It should be a list of ``[(fieldname, filename, file_content)]``. You can also use just ``[(fieldname, filename)]`` and the file content will be read from disk. Returns a `response object `_ tPOSTRIRJR4R@R]RK(R_(RRHRIRJR4R@R]RK((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytposts cCs4|id|d|d|d|d|d|d|S(s Do a PUT request. Very like the ``.get()`` method. ``params`` are put in the body of the request. ``upload_files`` is for file uploads. It should be a list of ``[(fieldname, filename, file_content)]``. You can also use just ``[(fieldname, filename)]`` and the file content will be read from disk. Returns a `response object `_ tPUTRIRJR4R@R]RK(R_(RRHRIRJR4R@R]RK((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytputs cCs4|id|d|d|d|d|ddd|S( s Do a DELETE request. Very like the ``.get()`` method. ``params`` are put in the body of the request. Returns a `response object `_ tDELETERIRJR4R@R]RKN(R_R'(RRHRIRJR4R@RK((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytdeletes  cCs|pdSxz|iD]l\}}|idjo d}n:|idjo d}nd|iddi}|||/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRD(s   c CsDdti}g}xP|D]H\}}|id||id||id|i|qWx|D]}|i|\}}}|id||id||fti|d} |id| pd|id|i|qpW|id|d|idd i|} d |} | | fS( s Encodes a set of parameters (typically a name/value list) and a set of files (a list of (name, filename, file_body)) into a typical POST body, returning the (content_type, body). s----------a_BoUnDaRy%s$s--s)Content-Disposition: form-data; name="%s"R?s8Content-Disposition: form-data; name="%s"; filename="%s"isContent-Type: %ssapplication/octet-streams s multipart/form-data; boundary=%s(trandomtappendt_get_file_infot mimetypest guess_typetjoin( RRItfilestboundarytlinestkeyRlt file_infotfilenametfcontenttbodyR^((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRY7s0       cCst|djog|d}|iotii|i|}nt|d}|i}|i|d||fSt|djo|Stdt |d dS(Niitrbiisuupload_files need to be a list of tuples of (fieldname, filename, filecontent) or (fieldname, filename); you gave: %rid( R[R-RtpathRsRtreadtcloset ValueErrortrepr(RRxRytftcontent((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRpTs    cCs|io|i|nt}|iot}x'|iiD]\}}|||/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRGgsh    E                 cCs t}|djodSt|ttfoS|i|jo>td|iditt ||i i |i fndS|djoN|idjo|idjodStd|i|i i |i fn||ijotd|i|fndS(Nt*s*Bad response: %s (not one of %s for %s) %ss, iis7Bad response: %s (not 200 OK or 3xx redirect for %s) %ssBad response: %s (not %s)(RR.R RTR@R*t full_statusRstmapR/RRHR{R'(RR@RRL((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs(   cCs%|iotd|indS(Ns!Application had errors logged: %s(terrorsR*(RR((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs cCs+|\}}}}t||||||S(N(t TestResponse(Rt.1t total_timeR@RJR{R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRsN(R R RtdisabledR'RR(R:RRNR_RaRcReRDRYRpRGRRR(((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyR+Zs. +   6 "       <  RcBs5eZdZdZdZdZdZRS(cCst|_||_dS(N(Rtcapturedtactual(RR((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs cCs$|ii||ii|dS(N(RRR(Rts((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRscCs|iidS(N(Rtflush(R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRscCs"x|D]}|i|qWdS(N(R(RRvtitem((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyt writelinesscCs |iiS(N(RR(R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs(R R RRRRR(((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs     RcBs2eZeZdZdZeeddZdZeeddZ e i de i e i BZdZedZd Zd Zddddded Zddddded Zd ZddZe i dZdZeeddZdZdZdZdZ dZ!RS(cCsz||_t|id|_||_||_ti|i|_||_ ||_ d|_ ||_ d|_dS(Ni(ttest_apptintRCR@RRJRtfromlistt header_dictR{RR't _normal_bodyRt_forms_indexed(RRR@RJR{RR((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs       cCs%|idjo|in|iS(s Returns a dictionary of ``Form`` objects. Indexes are both in order (from zero) and by form id (if the form is given an id). N(RR't _parse_forms(R((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyt forms__getstdocs A list of
s found on the page (instances of `Form `_) cCsE|i}|ptdnd|jotdn|dS(Ns*You used response.form, but no forms existis5You used response.form, but more than one form existsi(tformst TypeError(RR((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyt form__gets    s Returns a single `Form `_ instance; it is an error if there are multiple forms on the page. s<(/?)([:a-z0-9_\-]*)(.*?)>c CsZh}|_g}d}x|ii|iD]}|iddj}|idi}|djoq/n|oB|ptd|i|i |i||i !d}q/| ptd|i|i}q/W| ptd|i|xNt |D]@\}}t ||} | ||<| i o| || i unexpected at %ssNested form tags at %ssDanging form: %r(RR't_tag_retfinditerR{tgroupRhRtstartRotendt enumeratetFormtid( RRt form_textststartedtmatchRttagtittextR((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRs2         c Csd}xY|iD]N\}}|i|ijo)| ptd|||f|}qqW|djo\|tjoGtd|dig}|iD]\}}||q~fq|Sn|S(s Returns the named header; an error if there is not exactly one matching header (unless you give a default -- always an error if there is more than one header) s&Ambiguous header: %s matches %r and %rsNo header found: %r (from %s)s, N(R'RJRhRR tKeyErrorRs( RRtdefaulttfoundtcur_nameRlRtntv((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRk+s    AcCsNg}xA|iD]6\}}|i|ijo|i|qqW|S(sE Gets all headers by the ``name``, returns as a list (RJRhRo(RRRRRl((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pyRAs  cKs}|idjo|idjptd|i|id}ti|\}}ti|\}}|ii||S(s If this request is a redirect, follow that redirect. It is an error if this is not a redirect response. Returns another response object. i,is/You can only follow redirect responses (not %s)tlocation( R@RRRkRAt splittypet splithostRRN(RtkwRttypetrestthostR}((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytfollowKs# c Csbt}|idddddd d|d|d|d |d |d | \}} } |i| d S(s Click the link as described. Each of ``description``, ``linkid``, and ``url`` are *patterns*, meaning that they are either strings (regular expressions), compiled regular expressions (objects with a ``search`` method), or callables returning true or false. All the given patterns are ANDed together: * ``description`` is a pattern that matches the contents of the anchor (HTML and all -- everything between ```` and ````) * ``linkid`` is a pattern that matches the ``id`` attribute of the anchor. It will receive the empty string if no id is given. * ``href`` is a pattern that matches the ``href`` of the anchor; the literal content of that attribute, not the fully qualified attribute. * ``anchor`` is a pattern that matches the entire anchor, with its contents. If more than one link matches, then the ``index`` link is followed. If ``index`` is not given and more than one link matches, or if no link matches, then ``IndexError`` will be raised. If you give ``verbose`` then messages will be printed about each link, and why it does or doesn't match. If you use ``app.click(verbose=True)`` you'll see a list of all the links. You can use multiple criteria to essentially assert multiple aspects about the link, e.g., where the link's destination is. Rtat href_attrthreft href_extractRRt href_patternt html_patterntindextverboseturiN(Rt _find_elementR'tgoto( Rt descriptiontlinkidRtanchorRRRLt found_htmlt found_desct found_attrs((s>/opt/alt/python37/lib/python3.7/site-packages/paste/fixture.pytclickZs'  c Cskt}|idddddtidd|d|d |d |d |d | \}} } |i| d S(s Like ``.click()``, except looks for link-like buttons. This kind of button should look like ``