HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/twisted/internet/test/__pycache__/test_kqueuereactor.cpython-310.pyc
o

�b=�@sxdZddlZddlmZddlmZzddlmZmZdZ	Wne
y)dZ	Ynwdd�Zd	d
�ZGdd�de�Z
dS)
z.
Tests for L{twisted.internet.kqueuereactor}.
�N)�implementer)�TestCase)�
KQueueReactor�_IKQueuezKQueue not available.cOsdS)z
    Do nothing.
    N�)�args�kwargsrr�J/usr/lib/python3/dist-packages/twisted/internet/test/test_kqueuereactor.py�_fakeKEventsr
cs"tt�G��fdd�d��}|�S)a
    Create a fake that implements L{_IKQueue}.

    @param testKQueue: Something that acts like L{select.kqueue}.
    @param testKEvent: Something that acts like L{select.kevent}.
    @return: An implementation of L{_IKQueue} that includes C{testKQueue} and
        C{testKEvent}.
    cseZdZ�Z�ZdS)z"makeFakeKQueue.<locals>.FakeKQueueN)�__name__�
__module__�__qualname__�kqueue�keventr��
testKEvent�
testKQueuerr	�
FakeKQueue&sr)rr)rrrrrr	�makeFakeKQueues
rc@seZdZdZeZdd�ZdS)�KQueueTestsz�
    These are tests for L{KQueueReactor}'s implementation, not its real world
    behaviour. For that, look at
    L{twisted.internet.test.reactormixins.ReactorBuilder}.
    cCs*Gdd�d�}tt|t��}|�d�dS)zV
        L{KQueueReactor} handles L{errno.EINTR} in C{doKEvent} by returning.
        c@seZdZdZdd�ZdS)z*KQueueTests.test_EINTR.<locals>.FakeKQueuez�
            A fake KQueue that raises L{errno.EINTR} when C{control} is called,
            like a real KQueue would if it was interrupted.
            c_sttjd��)N�Interrupted)�OSError�errno�EINTR)�selfrrrrr	�controlBsz2KQueueTests.test_EINTR.<locals>.FakeKQueue.controlN)rrr
�__doc__rrrrr	r<srrN)rrr
�doKEvent)rr�reactorrrr	�
test_EINTR7s	zKQueueTests.test_EINTRN)rrr
r�
kqueueSkip�skiprrrrr	r.sr)rr�zope.interfacer�twisted.trial.unittestr�twisted.internet.kqreactorrrr �ImportErrorr
rrrrrr	�<module>s�