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/internet/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyc
ó
ê=Nc@sdZddlmZmZddlmZmZddlmZyddlm	Z	Wne
k
rod	ZnXddlmZdej
fd„ƒYZd	S(
s?
Tests for the inotify wrapper in L{twisted.internet.inotify}.
iÿÿÿÿ(tdefertreactor(tfilepathtruntime(tunittest(t_inotify(tinotifytTestINotifycBseZdZejjƒs$dZnd„Zd„Zdd„Z
d„Zd„Zd„Z
d„Zd	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!RS(s]
    Define all the tests for the basic functionality exposed by
    L{inotify.INotify}.
    s&This platform doesn't support INotify.cCsXtj|jƒƒ|_|jjƒtjƒ|_|jjƒ|j|jj	ƒdS(N(
RtFilePathtmktemptdirnametcreateDirectoryRtINotifytstartReadingt
addCleanuptloseConnection(tself((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pytsetUps


cCsFddd„ƒY}|jtjd|ƒƒ|jtjtjƒdS(s
        L{inotify.INotify} emits a C{RuntimeError} when initialized
        in an environment that doesn't support inotify as we expect it.

        We just try to raise an exception for every possible case in
        the for loop in L{inotify.INotify._inotify__init__}.
        tFakeINotifycBseZd„ZRS(cSstjƒ‚dS(N(RtINotifyError(R((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pytinit.s(t__name__t
__module__R(((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR-sRN((tpatchRRtassertRaisesR(RR((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_initializationErrors%scsˆˆdkr!ˆjjdƒ‰ntjƒ‰‡‡‡fd†}ˆj|ƒˆjjˆjdˆd‡fd†gƒ|ˆƒˆS(sæ
        Test notification from some filesystem operation.

        @param mask: The event mask to use when setting up the watch.

        @param operation: A function which will be called with the
            name of a file in the watched directory and which should
            trigger the event.

        @param expectedPath: Optionally, the name of the path which is
            expected to come back in the notification event; this will
            also be passed to C{operation} (primarily useful when the
            operation is being done to the directory itself, not a
            file in it).

        @return: A L{Deferred} which fires successfully when the
            expected event has been received or fails otherwise.
        sfoo.barcs4|\}}}ˆj|ˆƒˆj|ˆ@ƒdS(N(tassertEqualt
assertTrue(t.0twatchtfilenametevents(texpectedPathtmaskR(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt
cbNotifiedJsR!t	callbackscs
ˆj|ƒS(N(tcallback(targs(tnotified(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt<lambda>QsN(tNoneR
tchildRtDeferredtaddCallbackRR(RR!t	operationR R"((R R&RR!sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt_notificationTest4s
	
cCsd„}|jtj|ƒS(s{
        Reading from a file in a monitored directory sends an
        C{inotify.IN_ACCESS} event to the callback.
        cSs|jdƒ|jƒdS(Ntfoo(t
setContentt
getContent(tpath((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,[s
(R-Rt	IN_ACCESS(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_accessVs	cCsd„}|jtj|ƒS(sy
        Writing to a file in a monitored directory sends an
        C{inotify.IN_MODIFY} event to the callback.
        cSs*|jdƒ}|jdƒ|jƒdS(NtwR.(topentwritetclose(R1tfObj((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,gs
(R-Rt	IN_MODIFY(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_modifybs	cCsd„}|jtj|ƒS(s‰
        Changing the metadata of a a file in a monitored directory
        sends an C{inotify.IN_ATTRIB} event to the callback.
        cSs|jƒ|jƒdS(N(ttouch(R1((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,ts
(R-Rt	IN_ATTRIB(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_attribos	cCsd„}|jtj|ƒS(sž
        Closing a file which was open for writing in a monitored
        directory sends an C{inotify.IN_CLOSE_WRITE} event to the
        callback.
        cSs|jdƒ}|jƒdS(NR4(R5R7(R1R8((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,s(R-RtIN_CLOSE_WRITE(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_closeWrite{s	cCsd„}|jtj|ƒS(s°
        Closing a file which was open for reading but not writing in a
        monitored directory sends an C{inotify.IN_CLOSE_NOWRITE} event
        to the callback.
        cSs'|jƒ|jdƒ}|jƒdS(Ntr(R;R5R7(R1R8((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,Žs
(R-RtIN_CLOSE_NOWRITE(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_closeNoWriteˆs	cCsd„}|jtj|ƒS(st
        Opening a file in a monitored directory sends an
        C{inotify.IN_OPEN} event to the callback.
        cSs|jdƒ}|jƒdS(NR4(R5R7(R1R8((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,›s(R-RtIN_OPEN(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt	test_open–s	cs"‡fd†}ˆjtj|ƒS(s}
        Moving a file out of a monitored directory sends an
        C{inotify.IN_MOVED_FROM} event to the callback.
        cs9|jdƒ}|jƒ|jtjˆjƒƒƒdS(NR4(R5R7tmoveToRRR	(R1R8(R(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,§s
(R-Rt
IN_MOVED_FROM(RR,((RsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_movedFrom¢scs"‡fd†}ˆjtj|ƒS(sy
        Moving a file into a monitored directory sends an
        C{inotify.IN_MOVED_TO} event to the callback.
        cs0tjˆjƒƒ}|jƒ|j|ƒdS(N(RRR	R;RE(R1tp(R(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,´s
(R-RtIN_MOVED_TO(RR,((RsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_movedTo¯scCsd„}|jtj|ƒS(sw
        Creating a file in a monitored directory sends an
        C{inotify.IN_CREATE} event to the callback.
        cSs|jdƒ}|jƒdS(NR4(R5R7(R1R8((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,Ás(R-Rt	IN_CREATE(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_create¼s	cCsd„}|jtj|ƒS(sw
        Deleting a file in a monitored directory sends an
        C{inotify.IN_DELETE} event to the callback.
        cSs|jƒ|jƒdS(N(R;tremove(R1((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,Ís
(R-Rt	IN_DELETE(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_deleteÈs	cCs%d„}|jtj|d|jƒS(s{
        Deleting the monitored directory itself sends an
        C{inotify.IN_DELETE_SELF} event to the callback.
        cSs|jƒdS(N(RM(R1((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,ÙsR (R-RtIN_DELETE_SELFR
(RR,((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_deleteSelfÔs	cs+‡fd†}ˆjtj|dˆjƒS(sy
        Renaming the monitored directory itself sends an
        C{inotify.IN_MOVE_SELF} event to the callback.
        cs |jtjˆjƒƒƒdS(N(RERRR	(R1(R(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR,åsR (R-RtIN_MOVE_SELFR
(RR,((RsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt
test_moveSelfàscsy‡‡‡fd†}tjtjB}ˆjjˆjd|dtd|gƒˆjjdƒ‰tjƒ‰ˆj	ƒˆS(sŒ
        L{inotify.INotify} when initialized with autoAdd==True adds
        also adds the created subdirectories to the watchlist.
        cs)‡‡‡fd†}tjd|ƒdS(NcsLy*ˆjˆjjˆƒƒˆjdƒWntk
rGˆjƒnXdS(N(RRt
_isWatchedR$R(t	Exceptionterrback((Rtsubdirtd(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt_ôs

i(Rt	callLater(twpRR!RY(RRWRX(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt	_callbackñsR!tautoAddR#ttest(
RtIN_ISDIRRKRR
tTrueR)RR*R(RR\t	checkMask((RRWRXsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_simpleSubdirectoryAutoAddìs	

cs‚g‰‡‡‡‡fd†}tjtjB}ˆjjˆjd|dtd|gƒˆjjdƒ‰tjƒ‰ˆj	ƒˆS(sz
        L{inotify.INotify} removes a directory from the watchlist when
        it's removed from the filesystem.
        csd‡‡‡fd†}‡‡‡fd†}ˆsPˆj|ƒtjd|ƒntjd|ƒdS(NcsIy'ˆjˆjjˆƒƒˆjƒWntk
rDˆjƒnXdS(N(RRRTRMRURV((RRWRX(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyRYs

csMy+ˆjˆjjˆƒƒˆjdƒWntk
rHˆjƒnXdS(N(RRRTR$R(RURV((RRWRX(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt_ebs

i(tappendRRZ(R[RR!RYRc(tcallsRRWRX(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR\s
R!R]R#R^(
RR_RKRR
R`R)RR*R(RR\Ra((ReRRWRXsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_simpleDeleteDirectorys	

cCsh|jj|jdtƒ|j|jj|jƒƒ|jj|jƒ|j|jj|jƒƒdS(sR
        L{inotify.INotify.ignore} removes a directory from the watchlist
        R]N(RRR
R`RRTtignoretassertFalse(R((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_ignoreDirectory/scCs€x4tjD])\}}|jtj|ƒd|ƒq
WtjtjBtjB}|jttj|ƒƒtdddgƒƒdS(sy
        L{inotify.humaReadableMask} translates all the possible event
        masks to a human readable string.
        itclose_writetaccessR5N(Rt_FLAG_TO_HUMANRthumanReadableMaskR>R2RCtset(RR!tvalueRa((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_humanReadableMask9s!cCs©|jjdƒ}|jdƒ}|jdƒ}|jƒ|||g}|jj|jdtƒ|jj|jdtƒx'|D]}|j|jj|ƒƒq‚WdS(sŽ
        L{inotify.INotify.watch} with recursive==True will add all the
        subdirectories under the given path to the watchlist.
        R^ttest2ttest3t	recursiveN(R
R)tmakedirsRRR`RRT(RRWtsubdir2tsubdir3tdirsRX((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_recursiveWatchHs

cCs@ddl}tjƒ}|j|jƒ|jƒ|jƒdS(sœ
        L{inotify.INotify.connectionLost} if there's a problem while closing
        the fd shouldn't raise the exception but should log the error
        iÿÿÿÿN(tosRRR7t_fdRtflushLoggedErrors(RRytin_((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_connectionLostErrorYs

csy‡‡‡fd†}tjtjB}ˆjjˆjd|dtd|gƒˆjjdƒ‰tjƒ‰ˆj	ƒˆS(s”
        L{inotify.INotify.watch} with autoAdd==False will stop inotify
        from watching subdirectories created under the watched one.
        cs)‡‡‡fd†}tjd|ƒdS(NcsOy-ˆjˆjjˆjƒƒˆjdƒWntk
rJˆjƒnXdS(N(RhRRTR1R$R(RURV((RRWRX(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyRYls

i(RRZ(R[tfpR!RY(RRWRX(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR\isR!R]R#R^(
RR_RKRR
tFalseR)RR*R(RR\Ra((RRWRXsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_noAutoAddSubdirectoryds	

csÁˆjjdƒ‰ˆjƒtjƒ‰‡‡fd†}‡fd†}ˆjˆjjˆd|gƒƒˆjjˆƒˆjˆjjˆdtj	d|gƒƒˆj
|ƒˆjƒˆS(sœ
        L{inotify.INotify} will watch a filepath for events even if the same
        path is repeatedly added/removed/re-added to the watchpoints.
        sfoo.bar2cs7|\}}}ˆj|ˆƒˆj|tj@ƒdS(N(RRRRP(RtignoredRR(R R(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR"‡scsˆj|ƒdS(N(R$(R%(R&(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pytcallIt‹sR#R!(R
R)R;RR*RRRRgRPR+RM(RR"R‚((R R&RsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_seriesOfWatchAndIgnore~s
"	

csêˆjjdƒ}|jƒˆjjdƒ‰ˆjƒtjƒ‰‡‡fd†}‡fd†}ˆjˆjj|tjd|gƒƒˆj	|ƒˆjˆjjˆtjd|gƒƒˆjj
|ƒ|jƒˆjƒˆS(sr
        L{inotify.INotify} will ignore a filepath after it has been removed from
        the watch list.
        sfoo.bar2sfoo.bar3cs7|\}}}ˆj|ˆƒˆj|tj@ƒdS(N(RRRRP(RRRR(Rt
expectedPath2(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR"«scsˆj|ƒdS(N(R$(R%(R&(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR‚¯sR#(R
R)R;RR*RRRRPR+RgRM(RR R"R‚((R&RR„sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_ignoreFilePath s$

	
	

cCs9|jjdƒ}|jƒ|jt|jj|ƒdS(sf
        L{inotify.INotify} will raise KeyError if a non-watched filepath is
        ignored.
        sfoo.ignoredN(R
R)R;RtKeyErrorRRg(RR ((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_ignoreNonWatchedFileÃs
cstƒ‰‡‡‡‡‡‡‡fd†}tjtjB}ˆjjˆjd|dtd|gƒˆjjdƒ‰ˆjdƒ‰ˆjdƒ‰tj	ƒ‰ˆj
ƒˆjdƒˆjd	ƒˆjd
ƒg‰x*tˆƒD]\}}|j|j
ƒqßWˆS(sB
        L{inotify.INotify} with autoAdd==True for a watched path
        generates events for every file or directory already present
        in a newly created subdirectory under the watched one.

        This tests that we solve a race condition in inotify even though
        we may generate duplicate events.
        csåˆj|ƒtˆƒdkráy”ˆjˆjjˆƒƒˆjˆjjˆƒƒˆjˆjjˆƒƒˆˆˆˆg}ˆjtˆƒt|ƒƒˆjˆt|ƒƒWntk
rЈjƒqáXˆj	dƒndS(Ni(taddtlenRRRTRRnRURVR$R((R[RR!tcreated(RXReRuRRvt	someFilesRW(sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyR\Øs

R!R]R#R^RqRrs	file1.dats	file2.dats	file3.dat(RnRR_RKRR
R`R)RR*Rtt	enumerateR/R1(RR\RatiR((ReRRuRvR‹RWRXsF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyttest_complexSubdirectoryAutoAddÎs"		!	

N("RRt__doc__RtplatformtsupportsINotifytskipRRR(R-R3R:R=R?RBRDRGRJRLRORQRSRbRfRiRpRxR}R€RƒR…R‡RŽ(((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyRs:			"		
		
			
	
						)	
					"	#	N(Rttwisted.internetRRttwisted.pythonRRt
twisted.trialRRtImportErrorR(RtTestCaseR(((sF/usr/lib/python2.7/dist-packages/twisted/internet/test/test_inotify.pyt<module>s



Youez - 2016 - github.com/yon3zu
LinuXploit