PHP WebShell
Текущая директория: /usr/lib/python3/dist-packages/twisted/application/runner/test/__pycache__
Просмотр файла: test_pidfile.cpython-310.pyc
o
�b;2 � @ s� d Z ddlZddlmZ ddlmZmZ ddlm Z m
Z
mZ ddlm
Z
ddlZddlmZ ddlmZ dd lmZ d
dlmZ dd
lmZmZmZmZmZmZmZ de
de f de
de f fdd�ZG dd� dejj j!�Z"G dd� dejj j!�Z#dS )z3
Tests for L{twisted.application.runner._pidfile}.
� N)�wraps)�getpid�name)�Any�Callable�Optional)�verifyObject)�FilePath)�platform)�SkipTest� )�_pidfile� )�AlreadyRunningError�InvalidPIDFileError�IPIDFile�NonePIDFile�
NoPIDFound�PIDFile�StalePIDFileError�f.�returnc s* t � �dtdtdtdtf� fdd��}|S )a=
Decorator for tests that are not expected to work on all platforms.
Calling L{PIDFile.isRunning} currently raises L{NotImplementedError} on
non-POSIX platforms.
On an unsupported platform, we expect to see any test that calls
L{PIDFile.isRunning} to raise either L{NotImplementedError}, L{SkipTest},
or C{self.failureException}.
(C{self.failureException} may occur in a test that checks for a specific
exception but it gets NotImplementedError instead.)
@param f: The test method to decorate.
@return: The wrapped callable.
�self�args�kwargsr c sp t �� dk}|r� | g|�R i |��S | jtt| jf� | g|�R i |��}t|t�r6| �t|�� d�� d S d S )N�posixz isRunning is not implemented on )
r
�getType�assertRaises�NotImplementedErrorr �failureException�
isinstance�
assertTrue�str�
startswith)r r r � supported�e�r � �N/usr/lib/python3/dist-packages/twisted/application/runner/test/test_pidfile.py�wrapper1 s
���
�z$ifPlatformSupported.<locals>.wrapper)r r )r r) r'