+
    üÐj‚H  ã                   óš   € R t ^ RIt^ RIHtHt ^ RIHtHt ^ RIH	t	 ^ RI
Ht ]	! R4      e   ^ RIHt MRt ! R R	]P                  4      tR# )
z?
Tests for the inotify wrapper in L{twisted.internet.inotify}.
N)ÚdeferÚreactor)ÚfilepathÚruntime)ÚrequireModule)Úunittestztwisted.python._inotify)Úinotifyc                   ó  a € ] tR t^t o Rt]P                  P                  4       '       g   RtR t	R t
R!R ltR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R t%V t&R# )"ÚINotifyTestszQ
Define all the tests for the basic functionality exposed by
L{inotify.INotify}.
z&This platform doesn't support INotify.c                ó>  € \         P                  ! V P                  4       4      V n        V P                  P	                  4        \
        P                  ! 4       V n        V P
                  P                  4        V P                  V P
                  P                  4       R # ©N)
r   ÚFilePathÚmktempÚdirnameÚcreateDirectoryr   ÚINotifyÚstartReadingÚ
addCleanupÚloseConnection©Úselfs   &ÚD/usr/lib/python3/dist-packages/twisted/internet/test/test_inotify.pyÚsetUpÚINotifyTests.setUp   s^   € Ü×(Ò(¨¯©«Ó7ˆŒØ�‰×$Ñ$Ô&Ü—’Ó(ˆŒØ�‰×!Ñ!Ô#Ø�‰˜Ÿ™×3Ñ3Ö4ó    c                óÂ   €  ! R R4      pV P                  \        P                  RV! 4       4       V P                  \        P                  \        P                  4       R# )zð
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__}.
c                   ó&   a € ] tR t^-t o R tRtV tR# )Ú;INotifyTests.test_initializationErrors.<locals>.FakeINotifyc                ó,   € \         P                  ! 4       hr   )r   ÚINotifyErrorr   s   &r   ÚinitÚ@INotifyTests.test_initializationErrors.<locals>.FakeINotify.init.   s   € Ü×*Ò*Ó,Ð,r   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r    Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   ÚFakeINotifyr   -   s   ø‡ € ÷-ð -r   r+   Ú_inotifyN)Úpatchr   r   ÚassertRaisesr   )r   r+   s   & r   Útest_initializationErrorsÚ&INotifyTests.test_initializationErrors$   s>   € ÷	-ñ 	-ð 	�
‰
”7—?‘? J±³Ô>Ø×Ñœ'×.Ñ.´·±Ö@r   Nc                ó  a aaa€ Sf   S P                   P                  R4      o\        P                  ! 4       oVVV 3R lpSP	                  V4       S P
                  P                  S P                   SV3R l.R7       V! S4       S# )a~  
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.
zfoo.barc                 óž   <€ V w  rpSP                  VP                  4       SP                  4       4       SP                  VS,          4       R # r   )ÚassertEqualÚasBytesModeÚ
assertTrue)ÚresultÚwatchÚfilenameÚeventsÚexpectedPathÚmaskr   s   &   €€€r   Ú
cbNotifiedÚ2INotifyTests._notificationTest.<locals>.cbNotifiedK   s?   ø€ Ø(.Ñ%ˆU˜fØ×Ñ˜X×1Ñ1Ó3°\×5MÑ5MÓ5OÔPØ�O‰O˜F T�MÖ*r   c                  ó&   <€ SP                  V 4      # r   ©Úcallback©ÚargsÚnotifieds   *€r   Ú<lambda>Ú0INotifyTests._notificationTest.<locals>.<lambda>S   s   ø€ ¸h×>OÑ>OÐPTÔ>Ur   ©r;   Ú	callbacks)r   Úchildr   ÚDeferredÚaddCallbackr   r7   )r   r;   Ú	operationr:   r<   rC   s   ff&f @r   Ú_notificationTestÚINotifyTests._notificationTest4   su   û€ ð& ÒØŸ<™<×-Ñ-¨iÓ8ˆLÜ—>’>Ó#ˆ÷	+ð
 	×Ñ˜ZÔ(à�‰×ÑØ�L‰L˜tÔ0UÐ/Vð 	ô 	
ñ 	�,ÔØˆr   c                óH   € R pV P                  \        P                  V4      # )zc
Reading from a file in a monitored directory sends an
C{inotify.IN_ACCESS} event to the callback.
c                 óH   € V P                  R 4       V P                  4        R# )ó   fooN)Ú
setContentÚ
getContent©Úpaths   &r   rK   Ú+INotifyTests.test_access.<locals>.operation^   s   € Ø�O‰O˜FÔ#Ø�O‰OÖr   )rL   r   Ú	IN_ACCESS©r   rK   s   & r   Útest_accessÚINotifyTests.test_accessX   s"   € ò	ð ×%Ñ%¤g×&7Ñ&7¸ÓCÐCr   c                óH   € R pV P                  \        P                  V4      # )za
Writing to a file in a monitored directory sends an
C{inotify.IN_MODIFY} event to the callback.
c                 ó”   € V P                  R 4      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     R# ; i)ÚwrP   N)ÚopenÚwrite)rT   ÚfObjs   & r   rK   Ú+INotifyTests.test_modify.<locals>.operationj   s)   € Ø—‘˜3—” 4Ø—
‘
˜6Ô"÷  ——’ús	   š6¶A	)rL   r   Ú	IN_MODIFYrW   s   & r   Útest_modifyÚINotifyTests.test_modifyd   s"   € ò	#ð ×%Ñ%¤g×&7Ñ&7¸ÓCÐCr   c                óH   € R pV P                  \        P                  V4      # )zo
Changing the metadata of a file in a monitored directory
sends an C{inotify.IN_ATTRIB} event to the callback.
c                 óF   € V P                  4        V P                  4        R # r   )ÚtouchrS   s   &r   rK   Ú+INotifyTests.test_attrib.<locals>.operationv   s   € Ø�J‰JŒLØ�J‰JŽLr   )rL   r   Ú	IN_ATTRIBrW   s   & r   Útest_attribÚINotifyTests.test_attribp   s"   € ò	ð ×%Ñ%¤g×&7Ñ&7¸ÓCÐCr   c                óH   € R pV P                  \        P                  V4      # )z~
Closing a file which was open for writing in a monitored
directory sends an C{inotify.IN_CLOSE_WRITE} event to the
callback.
c                 óD   € V P                  R 4      P                  4        R# ©r\   N©r]   ÚcloserS   s   &r   rK   Ú/INotifyTests.test_closeWrite.<locals>.operationƒ   ó   € Ø�I‰I�c‹N× Ñ Ö"r   )rL   r   ÚIN_CLOSE_WRITErW   s   & r   Útest_closeWriteÚINotifyTests.test_closeWrite|   s"   € ò	#ð ×%Ñ%¤g×&<Ñ&<¸iÓHÐHr   c                óH   € R pV P                  \        P                  V4      # )z�
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.
c                 ód   € V P                  4        V P                  R 4      P                  4        R# )ÚrN)rf   r]   ro   rS   s   &r   rK   Ú1INotifyTests.test_closeNoWrite.<locals>.operation�   s   € Ø�J‰JŒLØ�I‰I�c‹N× Ñ Ö"r   )rL   r   ÚIN_CLOSE_NOWRITErW   s   & r   Útest_closeNoWriteÚINotifyTests.test_closeNoWriteˆ   s"   € ò	#ð ×%Ñ%¤g×&>Ñ&>À	ÓJÐJr   c                óH   € R pV P                  \        P                  V4      # )z\
Opening a file in a monitored directory sends an
C{inotify.IN_OPEN} event to the callback.
c                 óD   € V P                  R 4      P                  4        R# rm   rn   rS   s   &r   rK   Ú)INotifyTests.test_open.<locals>.operation›   rq   r   )rL   r   ÚIN_OPENrW   s   & r   Ú	test_openÚINotifyTests.test_open•   s    € ò	#ð ×%Ñ%¤g§o¡o°yÓAÐAr   c                óP   a € V 3R lpS P                  \        P                  V4      # )ze
Moving a file out of a monitored directory sends an
C{inotify.IN_MOVED_FROM} event to the callback.
c                 ó¬   <€ V P                  R 4      P                  4        V P                  \        P                  ! SP                  4       4      4       R# rm   )r]   ro   ÚmoveTor   r   r   ©rT   r   s   &€r   rK   Ú.INotifyTests.test_movedFrom.<locals>.operation¦   s4   ø€ Ø�I‰I�c‹N× Ñ Ô"Ø�K‰Kœ×)Ò)¨$¯+©+«-Ó8Ö9r   )rL   r   ÚIN_MOVED_FROMrW   s   f r   Útest_movedFromÚINotifyTests.test_movedFrom    s#   ø€ õ	:ð ×%Ñ%¤g×&;Ñ&;¸YÓGÐGr   c                óP   a € V 3R lpS P                  \        P                  V4      # )za
Moving a file into a monitored directory sends an
C{inotify.IN_MOVED_TO} event to the callback.
c                 ó’   <€ \         P                  ! SP                  4       4      pVP                  4        VP	                  V 4       R # r   )r   r   r   rf   r„   )rT   Úpr   s   & €r   rK   Ú,INotifyTests.test_movedTo.<locals>.operation²   s-   ø€ Ü×!Ò! $§+¡+£-Ó0ˆAØ�G‰GŒIØ�H‰H�TŽNr   )rL   r   ÚIN_MOVED_TOrW   s   f r   Útest_movedToÚINotifyTests.test_movedTo¬   s#   ø€ õ	ð
 ×%Ñ%¤g×&9Ñ&9¸9ÓEÐEr   c                óH   € R pV P                  \        P                  V4      # )z_
Creating a file in a monitored directory sends an
C{inotify.IN_CREATE} event to the callback.
c                 óD   € V P                  R 4      P                  4        R# rm   rn   rS   s   &r   rK   Ú+INotifyTests.test_create.<locals>.operation¿   rq   r   )rL   r   Ú	IN_CREATErW   s   & r   Útest_createÚINotifyTests.test_create¹   s"   € ò	#ð ×%Ñ%¤g×&7Ñ&7¸ÓCÐCr   c                óH   € R pV P                  \        P                  V4      # )z_
Deleting a file in a monitored directory sends an
C{inotify.IN_DELETE} event to the callback.
c                 óF   € V P                  4        V P                  4        R # r   )rf   ÚremoverS   s   &r   rK   Ú+INotifyTests.test_delete.<locals>.operationÊ   s   € Ø�J‰JŒLØ�K‰KŽMr   )rL   r   Ú	IN_DELETErW   s   & r   Útest_deleteÚINotifyTests.test_deleteÄ   s"   € ò	ð ×%Ñ%¤g×&7Ñ&7¸ÓCÐCr   c                ó^   € R pV P                  \        P                  WP                  R7      # )zc
Deleting the monitored directory itself sends an
C{inotify.IN_DELETE_SELF} event to the callback.
c                 ó&   € V P                  4        R # r   )r™   rS   s   &r   rK   Ú/INotifyTests.test_deleteSelf.<locals>.operationÖ   s   € Ø�K‰KŽMr   ©r:   )rL   r   ÚIN_DELETE_SELFr   rW   s   & r   Útest_deleteSelfÚINotifyTests.test_deleteSelfÐ   s0   € ò	ð ×%Ñ%Ü×"Ñ" I¿L¹Lð &ó 
ð 	
r   c                óð   a a€ V 3R lpS P                   P                  S P                  ^ V3R l.R7       \        P                  ! 4       oSP                  V4       S P                  P                  4        S# )z›
Deleting the monitored directory itself sends an
C{inotify.IN_DELETE_SELF} event to the callback
even if the mask isn't specified by the call to watch().
c                 óÎ   <€ V w  rpSP                  VP                  4       SP                  P                  4       4       SP                  V\        P
                  ,          4       R # r   )r3   r4   r   r5   r   r¢   )r6   r7   r8   r9   r   s   &   €r   r<   Ú6INotifyTests.test_deleteSelfForced.<locals>.cbNotifiedä   sJ   ø€ Ø(.Ñ%ˆU˜fØ×Ñ˜X×1Ñ1Ó3°T·\±\×5MÑ5MÓ5OÔPØ�O‰O˜F¤W×%;Ñ%;Õ;Ö<r   c                  ó&   <€ SP                  V 4      # r   r?   )rB   Úds   *€r   rD   Ú4INotifyTests.test_deleteSelfForced.<locals>.<lambda>ê   s   ø€ ¸Q¿Z¹ZÈÔ=Mr   rF   )r   r7   r   r   rI   rJ   r™   )r   r<   r©   s   f @r   Útest_deleteSelfForcedÚ"INotifyTests.test_deleteSelfForcedÝ   s_   ù€ õ	=ð
 	�‰×ÑØ�L‰L˜sÔ/MÐ.Nð 	ô 	
ô �NŠNÓˆØ	�‰�jÔ!à�‰×ÑÔØˆr   c                óh   a € V 3R lpS P                  \        P                  VS P                  R7      # )za
Renaming the monitored directory itself sends an
C{inotify.IN_MOVE_SELF} event to the callback.
c                 ón   <€ V P                  \        P                  ! SP                  4       4      4       R # r   )r„   r   r   r   r…   s   &€r   rK   Ú-INotifyTests.test_moveSelf.<locals>.operationù   s    ø€ Ø�K‰Kœ×)Ò)¨$¯+©+«-Ó8Ö9r   r¡   )rL   r   ÚIN_MOVE_SELFr   rW   s   f r   Útest_moveSelfÚINotifyTests.test_moveSelfó   s3   ø€ õ	:ð ×%Ñ%Ü× Ñ  )¸$¿,¹,ð &ó 
ð 	
r   c                ó:  a aa€ VV V3R lp\         P                  \         P                  ,          pS P                   P                  S P                  VRV.R7       S P                  P                  R4      o\        P                  ! 4       oSP                  4        S# )zt
L{inotify.INotify} when initialized with autoAdd==True adds
also adds the created subdirectories to the watchlist.
c                 óF   <€ VVV3R  lp\         P                  ! ^ V4       R# )c                  óÄ   <€  SP                  SP                  P                  S4      4       S P                  R 4       R #   \         d    S P                  4         R # i ; ir   )r5   r   Ú
_isWatchedr@   Ú	ExceptionÚerrback©r©   r   Úsubdirs   €€€r   Ú_ÚIINotifyTests.test_simpleSubdirectoryAutoAdd.<locals>._callback.<locals>._	  sG   ø€ ð Ø—O‘O D§L¡L×$;Ñ$;¸FÓ$CÔDØ—J‘J˜tÖ$øÜ ô  Ø—I‘I—Kð úó   ƒ;A  Á AÁAN©r   Ú	callLater)Úwpr8   r;   r»   r©   r   rº   s   &&& €€€r   Ú	_callbackÚ>INotifyTests.test_simpleSubdirectoryAutoAdd.<locals>._callback  ó   ø€ ÷ ô ×Ò˜a Ö#r   T©r;   ÚautoAddrG   Útest©	r   ÚIN_ISDIRr”   r7   r   rH   r   rI   r   ©r   rÁ   Ú	checkMaskr©   rº   s   f  @@r   Útest_simpleSubdirectoryAutoAddÚ+INotifyTests.test_simpleSubdirectoryAutoAdd   sy   ú€ ÷
	$ô ×$Ñ$¤w×'8Ñ'8Õ8ˆ	Ø�‰×ÑØ�L‰L˜y°$À9À+ð 	ô 	
ð —‘×#Ñ# FÓ+ˆÜ�NŠNÓˆØ×ÑÔ Øˆr   c                óB  a aaa€ . oVVV V3R lp\         P                  \         P                  ,          pS P                   P                  S P                  VRV.R7       S P                  P                  R4      o\        P                  ! 4       oSP                  4        S# )zb
L{inotify.INotify} removes a directory from the watchlist when
it's removed from the filesystem.
c                 óº   <€ VVV3R  lpVVV3R lpS'       g+   SP                  V4       \        P                  ! ^ V4       R# \        P                  ! ^ V4       R# )c                  óÂ   <€  SP                  SP                  P                  S4      4       SP                  4        R #   \         d    S P                  4         R # i ; ir   )r5   r   r¶   r™   r·   r¸   r¹   s   €€€r   r»   ÚEINotifyTests.test_simpleDeleteDirectory.<locals>._callback.<locals>._%  sD   ø€ ð Ø—O‘O D§L¡L×$;Ñ$;¸FÓ$CÔDØ—M‘M–OøÜ ô  Ø—I‘I—Kð ús   ƒ:? ¿AÁAc                  óÄ   <€  SP                  SP                  P                  S4      4       S P                  R 4       R #   \         d    S P                  4         R # i ; ir   ©ÚassertFalser   r¶   r@   r·   r¸   r¹   s   €€€r   Ú_ebÚGINotifyTests.test_simpleDeleteDirectory.<locals>._callback.<locals>._eb,  sI   ø€ ð Ø×$Ñ$ T§\¡\×%<Ñ%<¸VÓ%DÔEØ—J‘J˜tÖ$øÜ ô  Ø—I‘I—Kð úr½   N)Úappendr   r¿   )	rÀ   r8   r;   r»   rÔ   Úcallsr©   r   rº   s	   &&&  €€€€r   rÁ   Ú:INotifyTests.test_simpleDeleteDirectory.<locals>._callback"  s@   ø€ ÷ ÷ ÷ à—‘˜XÔ&Ü×!Ò! ! QÖ'ô ×!Ò! ! SÖ)r   TrÄ   rÆ   rÇ   )r   rÁ   rÊ   r×   r©   rº   s   f  @@@r   Útest_simpleDeleteDirectoryÚ'INotifyTests.test_simpleDeleteDirectory  s…   û€ ð
 ˆ÷	*ð 	*ô4 ×$Ñ$¤w×'8Ñ'8Õ8ˆ	Ø�‰×ÑØ�L‰L˜y°$À9À+ð 	ô 	
ð —‘×#Ñ# FÓ+ˆÜ�NŠNÓˆØ×ÑÔ Øˆr   c                óX  a aa€ VV 3R lpS P                  S P                  P                  S P                  \        P                  V3R l.R7      4       \
        P                  ! 4       oSP                  V4       S P                  P                  4        \
        P                  ! 4       oS# )z‚
L{inotify.INotify} closes the file descriptor after removing a
directory from the filesystem (and therefore from the watchlist).
c                 ó
  <€ VV3R  lpV w  r#pSP                  VP                  4       SP                  P                  4       4       SP                  V\        P
                  ,          4       \        P                  ! ^ V4       R# )c                  ó"  <€  SP                  SP                  P                  SP                  4      4       SP                  SP                  P                  4       S P                  R 4       R #   \         d    S P                  4         R # i ; ir   )rÓ   r   r¶   r   Ú	connectedr@   r·   r¸   )r©   r   s   €€r   r»   ÚIINotifyTests.test_deleteSelfLoseConnection.<locals>.cbNotified.<locals>._L  se   ø€ ð Ø×$Ñ$ T§\¡\×%<Ñ%<¸T¿\¹\Ó%JÔKØ×$Ñ$ T§\¡\×%;Ñ%;Ô<Ø—J‘J˜tÖ$øÜ ô  Ø—I‘I—Kð ús   ƒA*A/ Á/BÂBN)r3   r4   r   r5   r   r¢   r   r¿   )r6   r»   Úignoredr8   r9   r©   r   s   &    €€r   r<   Ú>INotifyTests.test_deleteSelfLoseConnection.<locals>.cbNotifiedK  sa   ø€ ö ð +1Ñ'ˆW Ø×Ñ˜X×1Ñ1Ó3°T·\±\×5MÑ5MÓ5OÔPØ�O‰O˜F¤W×%;Ñ%;Õ;Ô<Ü×Ò˜a Ö#r   c                  ó&   <€ SP                  V 4      # r   r?   rA   s   *€r   rD   Ú<INotifyTests.test_deleteSelfLoseConnection.<locals>.<lambda>]  s   ø€ ¨×):Ñ):¸4Ô)@r   rF   )	r5   r   r7   r   r¢   r   rI   rJ   r™   )r   r<   r©   rC   s   f @@r   Útest_deleteSelfLoseConnectionÚ*INotifyTests.test_deleteSelfLoseConnectionE  s€   ú€ ö	$ð 	�‰Ø�L‰L×ÑØ—‘Ü×+Ñ+Ü@ÐAð ó ô	
ô —>’>Ó#ˆØ×Ñ˜ZÔ(à�‰×ÑÔÜ�NŠNÓˆØˆr   c                ón  € V P                   P                  V P                  RR7       V P                  V P                   P	                  V P                  4      4       V P                   P                  V P                  4       V P                  V P                   P	                  V P                  4      4       R# )zB
L{inotify.INotify.ignore} removes a directory from the watchlist
T)rÅ   N)r   r7   r   r5   r¶   ÚignorerÓ   r   s   &r   Útest_ignoreDirectoryÚ!INotifyTests.test_ignoreDirectoryh  su   € ð 	�‰×Ñ˜4Ÿ<™<°ÐÔ6Ø�‰˜Ÿ™×/Ñ/°·±Ó=Ô>Ø�‰×Ñ˜DŸL™LÔ)Ø×Ñ˜Ÿ™×0Ñ0°·±Ó>Ö?r   c                óh  € \         P                   F2  w  rV P                  \         P                  ! V4      ^ ,          V4       K4  	  \         P                  \         P
                  ,          \         P                  ,          pV P                  \        \         P                  ! V4      4      0 Rm4       R# )za
L{inotify.humaReadableMask} translates all the possible event
masks to a human readable string.
N>   r]   ÚaccessÚclose_write)r   Ú_FLAG_TO_HUMANr3   ÚhumanReadableMaskrr   rV   r   Úset)r   r;   ÚvaluerÊ   s   &   r   Útest_humanReadableMaskÚ#INotifyTests.test_humanReadableMaskq  s{   € ô
 #×1Ô1‰KˆDØ×ÑœW×6Ò6°tÓ<¸QÕ?ÀÖGñ 2ô ×*Ñ*¬W×->Ñ->Õ>ÄÇÁÕPˆ	Ø×ÑÜ”×)Ò)¨)Ó4Ó5Ú-ö	
r   c                óª  € V P                   P                  R4      pVP                  R4      pVP                  R4      pVP                  4        WV.pV P                  P	                  V P                   RR7       V P                  P	                  V P                   RR7       V F-  pV P                  V P                  P                  V4      4       K/  	  R# )zv
L{inotify.INotify.watch} with recursive==True will add all the
subdirectories under the given path to the watchlist.
rÆ   Útest2Útest3T)Ú	recursiveN)r   rH   Úmakedirsr   r7   r5   r¶   )r   rº   Úsubdir2Úsubdir3Údirsr©   s   &     r   Útest_recursiveWatchÚ INotifyTests.test_recursiveWatch  s¥   € ð
 —‘×#Ñ# FÓ+ˆØ—,‘,˜wÓ'ˆØ—-‘- Ó(ˆØ×ÑÔØ Ð)ˆØ�‰×Ñ˜4Ÿ<™<°4ÐÔ8à�‰×Ñ˜4Ÿ<™<°4ÐÔ8ÛˆAØ�O‰O˜DŸL™L×3Ñ3°AÓ6Ö7ó r   c                ó®   € ^ RI p\        P                  ! 4       pVP                  VP                  4       VP                  4        V P                  4        R# )z„
L{inotify.INotify.connectionLost} if there's a problem while closing
the fd shouldn't raise the exception but should log the error
N)Úosr   r   ro   Ú_fdr   ÚflushLoggedErrors)r   rþ   Úin_s   &  r   Útest_connectionLostErrorÚ%INotifyTests.test_connectionLostError�  s;   € ó
 	ä�oŠoÓˆØ
�‰�—‘ÔØ×ÑÔØ×ÑÖ r   c                ó:  a aa€ VV V3R lp\         P                  \         P                  ,          pS P                   P                  S P                  VRV.R7       S P                  P                  R4      o\        P                  ! 4       oSP                  4        S# )z|
L{inotify.INotify.watch} with autoAdd==False will stop inotify
from watching subdirectories created under the watched one.
c                 óF   <€ VVV3R  lp\         P                  ! ^ V4       R# )c                  óÄ   <€  SP                  SP                  P                  S4      4       S P                  R 4       R #   \         d    S P                  4         R # i ; ir   rÒ   r¹   s   €€€r   r»   ÚEINotifyTests.test_noAutoAddSubdirectory.<locals>._callback.<locals>._¤  sI   ø€ ð Ø×$Ñ$ T§\¡\×%<Ñ%<¸VÓ%DÔEØ—J‘J˜tÖ$øÜ ô  Ø—I‘I—Kð úr½   Nr¾   )rÀ   Úfpr;   r»   r©   r   rº   s   &&& €€€r   rÁ   Ú:INotifyTests.test_noAutoAddSubdirectory.<locals>._callback¡  rÃ   r   FrÄ   rÆ   rÇ   rÉ   s   f  @@r   Útest_noAutoAddSubdirectoryÚ'INotifyTests.test_noAutoAddSubdirectory›  sy   ú€ ÷
	$ô ×$Ñ$¤w×'8Ñ'8Õ8ˆ	Ø�‰×ÑØ�L‰L˜y°%ÀIÀ;ð 	ô 	
ð —‘×#Ñ# FÓ+ˆÜ�NŠNÓˆØ×ÑÔ Øˆr   c                óð  a aa€ S P                   P                  R4      oSP                  4        \        P                  ! 4       oVV 3R lpV3R lpS P                  S P                  P                  SV.R7      4       S P                  P                  S4       S P                  S P                  P                  S\        P                  V.R7      4       SP                  V4       SP                  4        S# )z„
L{inotify.INotify} will watch a filepath for events even if the same
path is repeatedly added/removed/re-added to the watchpoints.
úfoo.bar2c                 óº   <€ V w  rpSP                  VP                  4       SP                  4       4       SP                  V\        P                  ,          4       R # r   ©r3   r4   r5   r   r¢   )r6   rà   r8   r9   r:   r   s   &   €€r   r<   Ú<INotifyTests.test_seriesOfWatchAndIgnore.<locals>.cbNotifiedÀ  sF   ø€ Ø*0Ñ'ˆW Ø×Ñ˜X×1Ñ1Ó3°\×5MÑ5MÓ5OÔPØ�O‰O˜F¤W×%;Ñ%;Õ;Ö<r   c                  ó*   <€ SP                  V 4       R # r   r?   rA   s   *€r   ÚcallItÚ8INotifyTests.test_seriesOfWatchAndIgnore.<locals>.callItÅ  ó   ø€ Ø×Ñ˜dÖ#r   ©rG   rF   )r   rH   rf   r   rI   r5   r   r7   rç   r¢   rJ   r™   )r   r<   r  r:   rC   s   f  @@r   Útest_seriesOfWatchAndIgnoreÚ(INotifyTests.test_seriesOfWatchAndIgnore¶  sÆ   ú€ ð
 —|‘|×)Ñ)¨*Ó5ˆØ×ÑÔä—>’>Ó#ˆö	=õ
	$ð 	�‰˜Ÿ™×*Ñ*¨<ÀFÀ8Ð*ÓLÔMØ�‰×Ñ˜LÔ)Ø�‰Ø�L‰L×ÑØ¤7×#9Ñ#9ÀfÀXð ó ô	
ð 	×Ñ˜ZÔ(ð 	×ÑÔàˆr   c                ó„  a aa€ S P                   P                  R4      pVP                  4        S P                   P                  R4      oSP                  4        \        P                  ! 4       oVV 3R lpV3R lpS P                  S P                  P                  V\        P                  V.R7      4       SP                  V4       S P                  S P                  P                  S\        P                  V.R7      4       S P                  P                  V4       VP                  4        SP                  4        S# )zZ
L{inotify.INotify} will ignore a filepath after it has been removed from
the watch list.
r  zfoo.bar3c                 óº   <€ V w  rpSP                  VP                  4       SP                  4       4       SP                  V\        P                  ,          4       R # r   r  )r6   rà   r8   r9   ÚexpectedPath2r   s   &   €€r   r<   Ú4INotifyTests.test_ignoreFilePath.<locals>.cbNotifiedç  sF   ø€ Ø*0Ñ'ˆW Ø×Ñ˜X×1Ñ1Ó3°]×5NÑ5NÓ5PÔQØ�O‰O˜F¤W×%;Ñ%;Õ;Ö<r   c                  ó*   <€ SP                  V 4       R # r   r?   rA   s   *€r   r  Ú0INotifyTests.test_ignoreFilePath.<locals>.callItì  r  r   r  )r   rH   rf   r   rI   r5   r   r7   r¢   rJ   rç   r™   )r   r:   r<   r  r  rC   s   f   @@r   Útest_ignoreFilePathÚ INotifyTests.test_ignoreFilePathÛ  sþ   ú€ ð
 —|‘|×)Ñ)¨*Ó5ˆØ×ÑÔØŸ™×*Ñ*¨:Ó6ˆØ×ÑÔä—>’>Ó#ˆö	=õ
	$ð 	�‰Ø�L‰L×Ñ˜|¬W×-CÑ-CÐPVÈxÐÓXô	
ð 	×Ñ˜ZÔ(à�‰Ø�L‰L×ÑØœw×5Ñ5À&Àð ó ô	
ð 	�‰×Ñ˜LÔ)à×ÑÔØ×ÑÔàˆr   c                ó²   € V P                   P                  R4      pVP                  4        V P                  \        V P
                  P                  V4       R# )zN
L{inotify.INotify} will raise KeyError if a non-watched filepath is
ignored.
zfoo.ignoredN)r   rH   rf   r.   ÚKeyErrorr   rç   )r   r:   s   & r   Útest_ignoreNonWatchedFileÚ&INotifyTests.test_ignoreNonWatchedFile  s@   € ð
 —|‘|×)Ñ)¨-Ó8ˆØ×ÑÔà×Ñœ( D§L¡L×$7Ñ$7¸ÖFr   c                ó¨  a aaaaa	a
€ \        4       oVVV VVV	V
3R lp\        P                  \        P                  ,          pS P                  P	                  S P
                  VRV.R7       S P
                  P                  R4      oSP                  R4      o	S	P                  R4      o
\        P                  ! 4       oS
P                  4        SP                  R4      S	P                  R4      S
P                  R	4      .o\        S4       FB  w  r4VP                  VP                  P                  \        P                  ! 4       4      4       KD  	  S# )
a  
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.
c                 ó|  <€ SP                  V4       \        S4      ^8X  dó    SP                  SP                  P	                  S	4      4       SP                  SP                  P	                  S
4      4       SP                  SP                  P	                  S4      4       SS	S
S.,           pV Uu0 uF  qDP                  4       kK  	  ppSP                  \        S4      \        V4      4       SP                  SV4       SP                  R4       R# R# u upi   \         d    SP                  4         R# i ; i)é   N)
ÚaddÚlenr5   r   r¶   r4   r3   r@   r·   r¸   )rÀ   r8   r;   ÚcreatedÚfr×   r©   r   Ú	someFilesrº   rø   rù   s   &&&  €€€€€€€r   rÁ   Ú?INotifyTests.test_complexSubdirectoryAutoAdd.<locals>._callback  sô   ø€ Ø�I‰I�hÔÜ�5‹z˜QŒð%Ø—O‘O D§L¡L×$;Ñ$;¸FÓ$CÔDØ—O‘O D§L¡L×$;Ñ$;¸GÓ$DÔEØ—O‘O D§L¡L×$;Ñ$;¸GÓ$DÔEØ'¨6°7¸GÐ*DÕD�GÙ8?Ó@¹°1Ÿ}™}ž¹�GÐ@Ø×$Ñ$¤S¨£Z´°W³Ô>Ø×$Ñ$ U¨GÔ4ð —J‘J˜tÖ$ñ ùò Aøô !ô  Ø—I‘I—Kð ús$   ¤BD Â2DÃ
8D ÄD ÄD;Ä:D;TrÄ   rÆ   rô   rõ   z	file1.datz	file2.datz	file3.dat)rï   r   rÈ   r”   r7   r   rH   r   rI   r÷   Ú	enumeraterQ   rT   ÚencodeÚsysÚgetfilesystemencoding)r   rÁ   rÊ   Úir8   r×   r©   r+  rº   rø   rù   s   f    @@@@@@r   Útest_complexSubdirectoryAutoAddÚ,INotifyTests.test_complexSubdirectoryAutoAdd  s	  þ€ ô “ˆ÷	%ó 	%ô  ×$Ñ$¤w×'8Ñ'8Õ8ˆ	Ø�‰×ÑØ�L‰L˜y°$À9À+ð 	ô 	
ð —‘×#Ñ# FÓ+ˆØ—,‘,˜wÓ'ˆØ—-‘- Ó(ˆÜ�NŠNÓˆØ×ÑÔð �L‰L˜Ó%Ø�M‰M˜+Ó&Ø�M‰M˜+Ó&ð
ˆ	ô % YÖ/‰KˆAØ×Ñ §¡× 4Ñ 4´S×5NÒ5NÓ5PÓ QÖRñ 0àˆr   )r   r   r   )'r#   r$   r%   r&   Ú__doc__r   ÚplatformÚsupportsINotifyÚskipr   r/   rL   rX   rb   ri   rs   rz   r€   rˆ   r�   r•   rœ   r£   r«   r±   rË   rÙ   rä   rè   rñ   rû   r  r
  r  r  r"  r2  r'   r(   r)   s   @r   r
   r
      sÉ   ø‡ € ñð
 ×Ñ×+Ñ+×-Ò-Ø7ˆò5òAô "òH
Dò
Dò
Dò
IòKò	Bò
HòFò	Dò
Dò
òò,
òò6(òT!òF@ò
ò8ò 
!òò6#òJ$òLG÷.ð .r   r
   )r4  r/  Útwisted.internetr   r   Útwisted.pythonr   r   Útwisted.python.reflectr   Útwisted.trialr   r   ÚTestCaser
   r"   r   r   Ú<module>r=     sC   ðñó ç +ß ,Ý 0Ý "áÐ*Ó+Ò7Þ(à€Gôe�8×$Ñ$ö er   