Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/python/test/__pycache__/test_deprecate.cpython-39.pyc
Ðазад
a k�h(� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZmZ zddl m Z W n eyf dZ Y n0 ddlm Z ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZ dd lmZ dd l m!Z! ddl"m#Z# ddl$m%Z% dd l&m'Z' G dd� d�Z(G dd� de'�Z)G dd� de'�Z*G dd� de%e'�Z+G dd� de'�Z,dd� Z-dd� Z.G dd� de'�Z/ee ddd d!��G d"d#� d#��Z0G d$d%� d%�Z1ee dd&d d�d'�d2d(d)��Z2G d*d+� d+e'�Z3G d,d-� d-e'�Z4G d.d/� d/e'�Z5G d0d1� d1e'�Z6dS )3zI Tests for Twisted's deprecation framework, L{twisted.python.deprecate}. � N)�normcase)�catch_warnings�simplefilter)�invalidate_caches)�Version)� deprecate)�DEPRECATION_WARNING_FORMAT�_appendToDocstring�_fullyQualifiedName�_getDeprecationDocstring�_getDeprecationWarningString�_mutuallyExclusiveArguments�_passedArgSpec�_passedSignature� deprecated�deprecatedKeywordParameter�deprecatedProperty�getDeprecationWarningString)�FilePath)�platform)�deprecatedattributes)�TwistedModulesMixin)�SynchronousTestCasec @ s e Zd ZdZdd� Zdd� ZdS )�_MockDeprecatedAttributezq Mock of L{twisted.python.deprecate._DeprecatedAttribute}. @ivar value: The value of the attribute. c C s || _ d S �N��value��selfr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/python/test/test_deprecate.py�__init__8 s z!_MockDeprecatedAttribute.__init__c C s | j S )z$ Get a known value. r �r r r r �get; s z_MockDeprecatedAttribute.getN)�__name__� __module__�__qualname__�__doc__r! r# r r r r r 1 s r c @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dS )�ModuleProxyTestsz� Tests for L{twisted.python.deprecate._ModuleProxy}, which proxies access to module-level attributes, intercepting access to deprecated attributes and passing through access to normal attributes. c K s2 t �d�}|�� D ]\}}t|||� qt�|�S )z� Create a temporary module proxy object. @param **kw: Attributes to initialise on the temporary module object @rtype: L{twistd.python.deprecate._ModuleProxy} �foo)�types� ModuleType�items�setattrr Z_ModuleProxy)r �attrs�mod�keyr r r r � _makeProxyI s zModuleProxyTests._makeProxyc C s. | j dd�}| �|jd� | �tt|d� dS )z� Getting a normal attribute on a L{twisted.python.deprecate._ModuleProxy} retrieves the underlying attribute's value, and raises C{AttributeError} if a non-existent attribute is accessed. Zhello)�SOME_ATTRIBUTEZDOES_NOT_EXISTN)r1 �assertIsr2 �assertRaises�AttributeError�getattr�r �proxyr r r �test_getattrPassthroughV s z(ModuleProxyTests.test_getattrPassthroughc C s2 | � � }t�|d�}td�|d<