Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/test/__pycache__/test_reflect.cpython-39.pyc
Ðазад
a k�h�_ � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZm Z m Z mZmZ ddl mZ G dd� d�ZG d d � d e�ZG dd� d�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� d�ZG dd� de�ZG dd� d�ZG dd� dee�Zedefddd��ZG d d!� d!e�ZG d"d#� d#e�ZG d$d%� d%e�ZG d&d'� d'e�Z G d(d)� d)e�Z!G d*d+� d+e�Z"G d,d-� d-e�Z#dS ).z6 Test cases for the L{twisted.python.reflect} module. � N)�deque)�reflect)�accumulateMethods�addMethodNamesToDict�fullyQualifiedName�prefixedMethodNames�prefixedMethods)�SynchronousTestCasec @ s e Zd ZdZdd� ZdS )�Basez` A no-op class which can be used to verify the behavior of method-discovering APIs. c C s dS )z9 A no-op method which can be discovered. N� ��selfr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/test/test_reflect.py�method s zBase.methodN)�__name__� __module__�__qualname__�__doc__r r r r r r s r c @ s e Zd ZdZdS )�SubzF A subclass of a class with a method which can be discovered. N)r r r r r r r r r $ s r c @ s e Zd ZdZdd� Zdd� ZdS )�Separatez= A no-op class with methods with differing prefixes. c C s dS )zJ A no-op method which a matching prefix to be discovered. Nr r r r r �good_method/ s zSeparate.good_methodc C s dS )zO A no-op method with a mismatched prefix to not be discovered. Nr r r r r � bad_method4 s zSeparate.bad_methodN)r r r r r r r r r r r * s r c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �AccumulateMethodsTestszt Tests for L{accumulateMethods} which finds methods on a class hierarchy and adds them to a dictionary. c C s* t � }i }t||� | �d|ji|� dS )z� If x is and instance of Base and Base defines a method named method, L{accumulateMethods} adds an item to the given dictionary with C{"method"} as the key and a bound method object for Base.method value. r N)r r �assertEqualr �r �x�outputr r r � test_ownClass@ s z$AccumulateMethodsTests.test_ownClassc C s* t � }i }t||� | �d|ji|� dS )a If x is an instance of Sub and Sub is a subclass of Base and Base defines a method named method, L{accumulateMethods} adds an item to the given dictionary with C{"method"} as the key and a bound method object for Base.method as the value. r N)r r r r r r r r �test_baseClassK s z%AccumulateMethodsTests.test_baseClassc C s, t � }i }t||d� | �d|ji|� dS )z� If a prefix is given, L{accumulateMethods} limits its results to methods beginning with that prefix. Keys in the resulting dictionary also have the prefix removed from them. �good_r N)r r r r r r r r �test_prefixW s z"AccumulateMethodsTests.test_prefixN)r r r r r r r r r r r r : s r c @ s e Zd ZdZdd� Zdd� ZdS )�PrefixedMethodsTestszr Tests for L{prefixedMethods} which finds methods on a class hierarchy and adds them to a dictionary. c C s"