← Back
Editing: test_twistd.cpython-38.pyc
U W[�! � @ sl d Z ddlmZmZ ddlZddlZddlZddlZddlZzddl Z ddl Z W n ek rl d Z Z Y nX zddlZ W n ek r� ddl Z Y nX ddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZmZ dd lmZmZmZ 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/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m*Z7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ zddl?mAZA W n ek �r� dZAY n&X ddlBmCZC ddlBmDZD ddlBmEZE zddl4mFZF W n ek �r2 dZFY nX zddlGZGW n ek �rZ dZGY nX zddlHZHddlIZIW n ek �r� dZIY nX eJedd�dk�r�dZKndZKd d!� ZLG d"d#� d#eM�ZNG d$d%� d%ejO�ZPG d&d'� d'e@jQ�ZRG d(d)� d)ejS�ZTG d*d+� d+ejS�ZUG d,d-� d-ejS�ZVG d.d/� d/eM�ZWG d0d1� d1ejX�ZYG d2d3� d3ejS�ZZG d4d5� d5ejS�Z[G d6d7� d7ejS�Z\G d8d9� d9ejS�Z]G d:d;� d;eM�Z^ee#�G d<d=� d=e^��Z_G d>d?� d?eM�Z`G d@dA� dAejS�ZadBdC� ZbdDdE� ZcG dFdG� dGejS�ZdG dHdI� dIejS�ZeG dJdK� dKejS�Zfee$�G dLdM� dMe.��ZgG dNdO� dOe@jQ�ZhdPdQ� ZiG dRdS� dSejS�ZjeAdk�rhdTef_kdS )UzE Tests for L{twisted.application.app} and L{twisted.scripts.twistd}. � )�absolute_import�divisionN)�implementer)�verifyObject)�unittest)�MockOS)�plugin�logger�internet)�service�app�reactors)� IServiceMaker)�Deferred)�IReactorDaemonize�_ISupportsExitSignalCapturing)�AlternateReactor)�globalLogBeginner�globalLogPublisher�ILogObserver)�ReactorBase)� MemoryReactor)�NativeStringIO�_PY3)� Componentized)�util)r �textFromEventDict)�platformType)� UsageError)�UserDatabase)�twistd)�_twistd_unix)�checkPID)�UnixApplicationRunner)� UnixAppLogger)�syslog�setuidz5Platform does not support --uid/--gid twistd options.c 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<