403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/twisted/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyc
ó
ê=Nc@sVdZddlmZddlmZdd	d„ƒYZdejfd„ƒYZdS(
s%
Tests for L{twisted.python.monkey}.
iÿÿÿÿ(tunittest(t
MonkeyPatchertTestObjcBseZd„ZRS(cCsd|_d|_d|_dS(Ns	foo values	bar values	baz value(tfootbartbaz(tself((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyt__init__
s		(t__name__t
__module__R(((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyRstMonkeyPatcherTestcBsqeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
RS(s;
    Tests for L{MonkeyPatcher} monkey-patching class.
    cCs(tƒ|_tƒ|_tƒ|_dS(N(Rt
testObjecttoriginalObjectRt
monkeyPatcher(R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pytsetUpscCse|jjƒ|j|jj|jjƒ|j|jj|jjƒ|j|jj|jjƒdS(sL
        A monkey patcher without patches shouldn't change a thing.
        N(R
tpatchtassertEqualRRRRR(R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyt
test_emptys
cCs}t|jddf|jddfƒ}|jƒ|jd|jjƒ|jd|jjƒ|j|jj|jjƒdS(s}
        Constructing a L{MonkeyPatcher} with patches should add all of the
        given patches to the patch list.
        RthahaRtheheN(RRRRRRRR(Rtpatcher((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_constructWithPatches+s
cCs@|jj|jddƒ|jjƒ|j|jjdƒdS(sf
        Patching an attribute that exists sets it to the value defined in the
        patch.
        RRN(R
taddPatchRRRR(R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_patchExisting8s
cCs3|jj|jddƒ|jt|jjƒdS(sT
        Patching a non-existing attribute fails with an C{AttributeError}.
        tnowheresblow up pleaseN(R
RRtassertRaisestAttributeErrorR(R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_patchNonExistingBscCs‚|jj|jddƒ|jj|jddƒ|jjƒ|j|jjdƒ|jjƒ|j|jj|jjƒdS(s|
        Adding a patch for an object and attribute that already have a patch
        overrides the existing patch.
        RtblahtBLAHN(R
RRRRRtrestoreR(R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_patchAlreadyPatchedKs

cCs||jj|jddƒ|jjƒ|jjƒ|j|jj|jjƒ|jjƒ|j|jj|jjƒdS(sH
        Restoring an already-restored monkey patch is a no-op.
        RRN(R
RRRRRRR(R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_restoreTwiceIsANoOpXs


cs]g‰d‡fd†}|jj|ddddƒ}|jd|ƒ|jdgˆƒdS(	s¤
        runWithPatches should run the given callable, passing in all arguments
        and keyword arguments, and return the return value of the callable.
        csˆj|||fƒdS(NR(tappend(tatbtc(tlog(s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pytfksiiR$i
RN(iii
(tNoneR
trunWithPatchesR(RR&tresult((R%s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_runWithPatchesDecorationds
csš‡fd†}ˆjjˆjddƒˆjj|ƒ}ˆjdˆjjˆjjf|ƒˆjj|ƒ}ˆjdˆjjˆjjf|ƒdS(s‘
        We should be able to call the same function with runWithPatches more
        than once. All patches should apply for each call.
        csˆjjˆjjˆjjfS(N(RRRR((R(s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyR&ysRRN(R
RRR(RRRR(RR&R)((Rs</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_repeatedRunWithPatchestscCsh|jj|jddƒ|j|jj|jjƒ|jjd„ƒ|j|jj|jjƒdS(so
        C{runWithPatches} should restore the original values after the function
        has executed.
        RRcSsdS(N(R'(((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyt<lambda>ŽsN(R
RRRRRR((R((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyttest_runWithPatchesRestores‡scs–‡fd†}ˆjjˆjddƒˆjjˆjddƒˆjtˆjj|ƒˆjˆjjˆjjƒˆjˆjj	ˆjj	ƒdS(sv
        Test runWithPatches restores the original values even when the function
        raises an exception.
        cs9ˆjˆjjdƒˆjˆjjdƒtd‚dS(NRtblahblahsSomething went wrong!(RRRRtRuntimeError((R(s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyt_—sRRRR.N(
R
RRRR/R(RRRR(RR0((Rs</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyt&test_runWithPatchesRestoresOnException’s(RR	t__doc__RRRRRRR R*R+R-R1(((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyR
s		
	
	
			
				N((R2t
twisted.trialRttwisted.python.monkeyRRtTestCaseR
(((s</usr/lib/python2.7/dist-packages/twisted/test/test_monkey.pyt<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit