File: //lib/python3/dist-packages/twisted/test/__pycache__/test_twistd.cpython-310.pyc
o
�b( � @ s� d Z ddlZddlZddlZddlZddlZddlZz
ddlZddl Z
W n
ey1 dZ dZY nw e
Z eZddlm
Z
ddlmZ ddlmZ ddlmZ ddlmZmZmZ ddlmZmZmZ dd lmZ dd
lmZ ddl m!Z! ddl"m#Z#m$Z$ dd
l%m&Z& ddl'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m(Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA e5d�ZBeBr�ddlCmDZDmEZEmFZF e5d�ZGe5d�ZHe5d�ZIe5d�ZJd d!� ZKG d"d#� d#�ZLG d$d%� d%ejM�ZNG d&d'� d'e;jO�ZPG d(d)� d)eA�ZQeeB d*�G d+d,� d,eA��ZRG d-d.� d.eA�ZSG d/d0� d0�ZTG d1d2� d2ejU�ZVG d3d4� d4eA�ZWeeB d*�G d5d6� d6eA��ZXeeB d*�G d7d8� d8eA��ZYeeB d*�G d9d:� d:eA��ZZG d;d<� d<�Z[ee#�G d=d>� d>e[��Z\G d?d@� d@�Z]G dAdB� dBeA�Z^dCdD� Z_dEdF� Z`G dGdH� dHeA�ZaeeB d*�G dIdJ� dJeA��ZbeeB dK�G dLdM� dMeA��Zcee$�G dNdO� dOe=��ZdG dPdQ� dQe;jO�ZedRdS� ZfG dTdU� dUeA�ZgdS )VzE
Tests for L{twisted.application.app} and L{twisted.scripts.twistd}.
� N)�StringIO)�skipIf)�implementer)�verifyObject)�internet�logger�plugin)�app�reactors�service)�
IServiceMaker)�ReactorBase)�Deferred)�IReactorDaemonize�_ISupportsExitSignalCapturing)�AlternateReactor)�ILogObserver�globalLogBeginner�globalLogPublisher)�util)�
Componentized)�UserDatabase)r �textFromEventDict)�
requireModule)�platformType)�
UsageError)�twistd)�
MemoryReactor)�MockOS)�TestCaseztwistd.scripts._twistd_unix)�UnixApplicationRunner�
UnixAppLogger�checkPIDztwistd.python.syslog�profile�pstats�cProfilec s| t �t�� �}t�t�� ��t� }|�||j |� |j
|j|j� � ��fdd�}| t d|j
� | td|� | t d|j� dS )au
Patch L{pwd.getpwnam} so that it behaves as though only one user exists
and patch L{grp.getgrnam} so that it behaves as though only one group
exists.
@param patch: A function like L{TestCase.patch} which will be used to
install the fake implementations.
@type user: C{str}
@param user: The name of the single user which will exist.
@type uid: C{int}
@param uid: The UID of the single user which will exist.
@type group: C{str}
@param group: The name of the single user which will exist.
@type gid: C{int}
@param gid: The GID of the single group which will exist.
c s<