File: //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_default.cpython-310.pyc
o
�b[
� @ s� d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ dd lmZ ed
d�Zed
d�Zed
d�Zed
d�ZG dd� de�ZG dd� de�ZG dd� de�ZdS )z(
Tests for L{twisted.internet.default}.
� N)�default)�_getInstallFunction�install)�IReactorCore)� NoReactor)�
requireModule)�Platform)�SynchronousTestCase�posix�other�linux2�nt�win32�darwinc @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �PollReactorTestsz�
Tests for the cases of L{twisted.internet.default._getInstallFunction}
in which it picks the poll(2) or epoll(7)-based reactors.
c C s. t td�r| �|jd� dS | �|jd� dS )zz
Assert the given function will install the poll() reactor, or select()
if poll() is unavailable.
�pollztwisted.internet.pollreactor�twisted.internet.selectreactorN)�hasattr�select�assertEqual�
__module__��selfr � r �D/usr/lib/python3/dist-packages/twisted/internet/test/test_default.py�assertIsPoll s
zPollReactorTests.assertIsPollc C s t t�}| �|� dS )z�
L{_getInstallFunction} chooses the poll reactor on arbitrary Unix
platforms, falling back to select(2) if it is unavailable.
N)r �unixr r r r r � test_unix* s zPollReactorTests.test_unixc C s4 t t�}td�du r| �|� dS | �|jd� dS )zu
L{_getInstallFunction} chooses the epoll reactor on Linux, or poll if
epoll is unavailable.
ztwisted.internet.epollreactorN)r �linuxr r r r r r r r �
test_linux2 s zPollReactorTests.test_linuxN)�__name__r �__qualname__�__doc__r r r r r r r r s
r c @ � e Zd ZdZdd� Zdd� ZdS )�SelectReactorTestsz�
Tests for the cases of L{twisted.internet.default._getInstallFunction}
in which it picks the select(2)-based reactor.
c C � t t�}| �|jd� dS )zM
L{_getInstallFunction} chooses the select reactor on macOS.
r N)r �osxr r r r r r �test_osxD � zSelectReactorTests.test_osxc C r% )zO
L{_getInstallFunction} chooses the select reactor on Windows.
r N)r �windowsr r r r r r �test_windowsK r( zSelectReactorTests.test_windowsN)r r r! r"