HEX
Server: nginx/1.24.0
System: Linux localhost 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: www (1000)
PHP: 8.3.27
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,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,imap_open,apache_setenv
Upload Files
File: //lib/python3/dist-packages/twisted/python/test/__pycache__/test_inotify.cpython-310.pyc
o

�b~�@s�dZddlmZddlmZddlmZzddlmZWne	y'dZ
YnweZ
e
rGe��rGddlm
Z
mZmZddlmZmZmZmZndZ
Gd	d
�d
e�ZdS)z'
Tests for L{twisted.python._inotify}.
�)�FilePath)�platform)�TestCase)�_inotifyN)�c_char_p�c_int�c_uint32)�INotifyError�add�init�initializeModulec@sLeZdZdZedurdZdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�INotifyTestsz/
    Tests for L{twisted.python._inotify}.
    Nz&This platform doesn't support INotify.cC�"Gdd�d�}|�tt|��dS)z�
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_init} attribute, L{ImportError} is raised.
        c@�eZdZdd�Zdd�ZdS)z+INotifyTests.test_missingInit.<locals>.libccS�dS�N���selfrr�B/usr/lib/python3/dist-packages/twisted/python/test/test_inotify.py�inotify_add_watch*�z=INotifyTests.test_missingInit.<locals>.libc.inotify_add_watchcSrrrrrrr�inotify_rm_watch-rz<INotifyTests.test_missingInit.<locals>.libc.inotify_rm_watchN)�__name__�
__module__�__qualname__rrrrrr�libc)�rN��assertRaises�ImportErrorr�rrrrr�test_missingInit#�zINotifyTests.test_missingInitcCr)z�
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_add_watch} attribute, L{ImportError} is raised.
        c@r)z*INotifyTests.test_missingAdd.<locals>.libccSrrrrrrr�inotify_init9rz7INotifyTests.test_missingAdd.<locals>.libc.inotify_initcSrrrrrrrr<rz;INotifyTests.test_missingAdd.<locals>.libc.inotify_rm_watchN)rrrr$rrrrrr8rrNrr!rrr�test_missingAdd2r#zINotifyTests.test_missingAddcCr)z�
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_rm_watch} attribute, L{ImportError} is raised.
        c@r)z-INotifyTests.test_missingRemove.<locals>.libccSrrrrrrrr$Hrz:INotifyTests.test_missingRemove.<locals>.libc.inotify_initcSrrrrrrrrKrz?INotifyTests.test_missingRemove.<locals>.libc.inotify_add_watchN)rrrr$rrrrrrGrrNrr!rrr�test_missingRemoveAr#zINotifyTests.test_missingRemovecCs�Gdd�d�}|�}t|�|�|jjg�|�|jjt�|�|jjttg�|�|jjt�|�|jjttt	g�|�|jjt�dS)z�
        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.
        c@s<eZdZdd�Zee�Zdd�Zee�Zdd�Zee�ZdS)z(INotifyTests.test_setTypes.<locals>.libccSrrrrrrrr$Xrz5INotifyTests.test_setTypes.<locals>.libc.inotify_initcSrrrrrrrr]rz9INotifyTests.test_setTypes.<locals>.libc.inotify_rm_watchcSrrrrrrrrbrz:INotifyTests.test_setTypes.<locals>.libc.inotify_add_watchN)rrrr$�staticmethodrrrrrrrWsrN)
r�assertEqualr$�argtypes�restyperrrrr)rr�crrr�
test_setTypesPszINotifyTests.test_setTypescCs.Gdd�d�}|�td|��|�tt�dS)zg
        If C{inotify_init} returns a negative number, L{init} raises
        L{INotifyError}.
        c@�eZdZdd�ZdS)z*INotifyTests.test_failedInit.<locals>.libccS�dS�N���rrrrrr$yrz7INotifyTests.test_failedInit.<locals>.libc.inotify_initN)rrrr$rrrrrx�rN)�patch�inotifyrr	rr!rrr�test_failedInitrszINotifyTests.test_failedInitcCs8Gdd�d�}|�td|��|�ttdtd�d�dS)zk
        If C{inotify_add_watch} returns a negative number, L{add}
        raises L{INotifyError}.
        c@r-)z.INotifyTests.test_failedAddWatch.<locals>.libccSr.r/r)r�fd�path�maskrrrr�rz@INotifyTests.test_failedAddWatch.<locals>.libc.inotify_add_watchN)rrrrrrrrr�r1r�z/foorN)r2r3rr	r
rr!rrr�test_failedAddWatchsz INotifyTests.test_failedAddWatch)rrr�__doc__r3�skipr"r%r&r,r4r9rrrrr
s"
r
)r:�twisted.python.filepathr�twisted.python.runtimer�twisted.trial.unittestr�twisted.pythonrr r3�supportsINotify�ctypesrrr�twisted.python._inotifyr	r
rrr
rrrr�<module>s�