Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/application/runner/test/__pycache__/test_pidfile.cpython-39.pyc
Ðазад
a k�h;2 � @ s� d Z ddlZddlmZ ddlmZmZ ddlm Z m Z mZ ddlm Z ddlZddlmZ ddlmZ dd lmZ d dlmZ dd lmZmZmZmZmZmZmZ e de f e de f d�dd�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 � �ttttd�� 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 sl t �� dk}|r&� | g|�R i |��S | jtt| jf� | g|�R i |��}t|t�rh| �t|�� d�� d S )N�posixz isRunning is not implemented on ) r ZgetType�assertRaises�NotImplementedErrorr ZfailureException� isinstance� assertTrue�str� startswith)r r r � supported�e�r � ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/application/runner/test/test_pidfile.py�wrapper1 s ��� z$ifPlatformSupported.<locals>.wrapper)r r )r r'