Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/python/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyc


Mc@sdZddlmZddlmZejrddlmZmZm	Z	ddl
mZddlm
Z
mZmZmZnd	ZdefdYZd	S(
s'
Tests for L{twisted.python._inotify}.
i(tTestCase(tplatform(tc_inttc_uint32tc_char_p(t_inotify(tINotifyErrortinitializeModuletinittaddtINotifyTestscBsYeZdZedkr!dZndZdZdZdZ	dZ
dZRS(	s/
    Tests for L{twisted.python._inotify}.
    s&This platform doesn't support INotify.cCs-dddY}|jtt|dS(s
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_init} attribute, L{ImportError} is raised.
        tlibccBseZdZdZRS(cSsdS(N((tself((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pytinotify_add_watch"scSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pytinotify_rm_watch$s(t__name__t
__module__R
R(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR!s	N((tassertRaisestImportErrorR(RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyttest_missingInitscCs-dddY}|jtt|dS(s
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_add_watch} attribute, L{ImportError} is raised.
        RcBseZdZdZRS(cSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pytinotify_init/scSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR1s(RRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR.s	N((RRR(RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyttest_missingAdd)scCs-dddY}|jtt|dS(s
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_rm_watch} attribute, L{ImportError} is raised.
        RcBseZdZdZRS(cSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR<scSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR
>s(RRRR
(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR;s	N((RRR(RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyttest_missingRemove6scCsdddY}|}t||j|jjg|j|jjt|j|jjttg|j|jjt|j|jjttt	g|j|jjtdS(s
        If the I{libc} object passed to L{initializeModule} has all of the
        necessary attributes, it sets the C{argtypes} and C{restype} attributes
        of the three ctypes methods used from libc.
        RcBsGeZdZeeZdZeeZdZeeZRS(cSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyRJscSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyRNscSsdS(N((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR
Rs(RRRtstaticmethodRR
(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyRIs			N((
RtassertEqualRtargtypestrestypeRRR
RR(RRtc((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyt
test_setTypesCs
	
cCs=dddY}|jtd||jttdS(sg
        If C{inotify_init} returns a negative number, L{init} raises
        L{INotifyError}.
        RcBseZdZRS(cSsdS(Ni((R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyRis(RRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyRhsN((tpatchRRRR(RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyttest_failedInitcscCsFdddY}|jtd||jttddddS(sk
        If C{inotify_add_watch} returns a negative number, L{add}
        raises L{INotifyError}.
        RcBseZdZRS(cSsdS(Ni((Rtfdtpathtmask((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR
us(RRR
(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyRtsis/fooiN((RRRRR	(RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyttest_failedAddWatchosN(RRt__doc__RtNonetskipRRRRRR"(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyR
s		
	
	
	 	N(R#ttwisted.trial.unittestRttwisted.python.runtimeRtsupportsINotifytctypesRRRttwisted.pythonRttwisted.python._inotifyRRRR	R$R
(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_inotify.pyt<module>s%