← Back
Editing: test_default.cpython-38.pyc
U W[� � @ s� d Z ddlmZmZ ddlZddlZddlmZ ddlm Z ddl mZ ddlm Z ddlmZmZ dd lmZ dd lmZ e dd�Ze dd �Ze dd�Ze dd�ZG dd� de�ZG dd� de�ZG dd� de�ZdS )z( Tests for L{twisted.internet.default}. � )�division�absolute_importN)�SynchronousTestCase)�Platform)� requireModule)�default)�_getInstallFunction�install)� NoReactor)�IReactorCore�posix�otherZlinux2�ntZwin32�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� n| �|jd� dS )zz Assert the given function will install the poll() reactor, or select() if poll() is unavailable. Zpollztwisted.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 s2 t t�}td�dkr | �|� n| �|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_linux5 s �zPollReactorTests.test_linuxN)�__name__r �__qualname__�__doc__r r r r r r r r s r c @ s 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 s t t�}| �|jd� dS )zM L{_getInstallFunction} chooses the select reactor on macOS. r N)r �osxr r r r r r �test_osxH s �zSelectReactorTests.test_osxc C s t t�}| �|jd� dS )zO L{_getInstallFunction} chooses the select reactor on Windows. r N)r �windowsr r r r r r �test_windowsQ s �zSelectReactorTests.test_windowsN)r r r r! r$ r&