관리-도구
편집 파일: test.cpython-38.pyc
U )�e/\ � @ s^ d dl mZmZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlZd dlm Z mZmZmZmZmZmZmZ d dlmZmZmZmZmZmZmZ d dlmZmZmZmZm Z m!Z!m"Z" d dlm#Z#m$Z$m%Z%m&Z& d dlm'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 d dlm1Z1m2Z2m3Z3m4Z4 d d lm5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z> d d l?m@Z@ d dlAmBZB d dlCmDZD d d lEmFZFmGZGmHZHmIZI d dlJmKZLmMZNmOZPmQZR d dlJmSZTmUZVmWZX d dlJmYZZm[Z\m]Z^ d dlJm_Z`maZbmcZdmeZf d dlJmgZhmiZj e6�rd dlJmkZl zd dlmZmW n enk �r< dZmY nX zeo W n" epk �rh d dlmoZo Y nX eqZrer�sd�d Ztdd� ZuG dd� de jv�ZvzG dd� de�ZwW n" exk �r� e�y� d ZwY nX zG dd� deze�Z{W n" exk �r e�y� d Z{Y nX zG d d!� d!e|e�Z}W n" exk �r@ e�y� d Z}Y nX zG d"d#� d#e�Z~W n( exk �r~ Z zeZ~W 5 dZ[X Y nX zG d$d%� d%e�Z�W n( exk �r� Z zeZ�W 5 dZ[X Y nX zG d&d'� d'e�Z�W n exk �r� eZ�Y nX zG d(d)� d)e�Z�W n( exk �r* Z zeZ�W 5 dZ[X Y nX zed*d+eqd,�Z�W n" exk �r` e�y� d Z�Y nX zG d-d.� d.e�Z�W n" exk �r� e�y� d Z�Y nX zG d/d0� d0e�Z�W n" exk �r� e�y� d Z�Y nX zed1d2eqd,�Z�W n" exk �r e�y� d Z�Y nX zed3d4�Z�W n" exk �r8 e�y� d Z�Y nX z$G d5d6� d6e�Z�G d7d8� d8e��Z�W n" exk �r� e�y� d Z�Y nX zG d9d:� d:e�Z�W n exk �r� Y nX dd eIffd;d<�Z�d eIffd=d>�Z�e7�rdd?l�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z� dd@l�m�Z� e{e�_{e�e�_�e�e�_�e5e=k�r*ddAl�m�Z� G dBdC� dCe��Z�G dDdE� dEev�Z�G dFdG� dGev�Z�G dHdI� dIev�Z�G dJdK� dKev�Z�G dLdM� dMev�Z�G dNdO� dOev�Z�G dPdQ� dQev�Z�G dRdS� dSev�Z�G dTdU� dUe jv�Z�G dVdW� dWev�Z�G dXdY� dYev�Z�G dZd[� d[ev�Z�G d\d]� d]ev�Z�G d^d_� d_ev�Z�G d`da� daev�Z�G dbdc� dcev�Z�ddZ�ddZ�ddZ�ddZ�ddZ�ddZ�deZ�deZ�dfZ�dfZ�ddZ�ddZ�ddZ�ddZ�ddZ�ddZ�dgZ�dhZ�ddZ�diZ�djZ�dkZ�dlZ�dmZ�G dndo� doev�Z�dpdq� Z�drds� Z�eqdtk�rZe�ġ Z�dZ�zJe7�r�e�e�_�e j�dvdw�Z�ejΠϡ e�j�j�D ]\Z�Z�e�dxe�e�f � �q�W 5 e��e�du� eƐrXe��e�e�j�jːpFe�j�j̃�rRd�pTd � X dS )y� )�division�print_functionN)�EnumType�EnumMeta�Enum�IntEnum�StrEnum�LowerStrEnum�UpperStrEnum�ReprEnum)�AutoNumberEnum�MultiValueEnum�OrderedEnum� UniqueEnum�AddValueEnum�Flag�IntFlag)� NamedTuple� TupleSize� NamedConstant�constant�NoAlias�AddValue�Unique)�STRICT�CONFORM�EJECT�KEEP) �_reduce_ex_by_name�unique�skip�extend_enum�auto�enum� MultiValue�member� nonmember�no_arg)� basestring�baseinteger�unicode� enum_property) �pyver�PY2�PY3�PY2_6�PY3_3�PY3_4�PY3_5�PY3_6�PY3_7�PY3_11)� _high_bit)�OrderedDict)� timedelta)�dumps�loads� PicklingError�HIGHEST_PROTOCOL)�or_�and_�xor�inv)�abs�add�floordiv)�lshift�rshift�mod)�mul�neg�pos�pow)�truediv�sub)�div)�any�.���c C s2 |� t�t�� |� tjdttjtjB d�� |S )Nz doc/aenum.rst)�packageZoptionflags)ZaddTests�doctestZDocTestSuite�aenumZDocFileSuite�ELLIPSISZNORMALIZE_WHITESPACE)�loader�tests�ignore� rX �8/opt/hc_python/lib/python3.8/site-packages/aenum/test.py� load_tests- s �rZ c s e Zd Z� fdd�Z� ZS )�TestCasec s6 t | dd �}|d kr t | d�| _tt| �j||� d S )N�assertRaisesRegexZassertRaisesRegexp)�getattrr\ �superr[ �__init__)�self�args�kwds�regex�� __class__rX rY r_ 8 s zTestCase.__init__)�__name__� __module__�__qualname__r_ � __classcell__rX rX rd rY r[ 6 s r[ c @ s e Zd ZdZdZdZdS )�Stooges� � � N�rf rg rh �LARRY�CURLY�MOErX rX rX rY rj A s rj rk c @ s e Zd ZdZdZdZdS )� IntStoogesrk rl rm Nrn rX rX rX rY rr I s rr c @ s e Zd ZdZdZdZdS )�FloatStoogesg= ףp=�?g�(\��@g�R$_ $ @Nrn rX rX rX rY rs Q s rs c @ s e Zd ZdZdZdZdZdZdS )�FlagStoogesrk rl � � � N�rf rg rh ro rp rq �PMASK�CMASKrX rX rX rY rt Y s rt c @ s$ e Zd ZdZdZdZdZdZdZdS )�FlagStoogesWithZeror rk rl ru rv rw N� rf rg rh �NOFLAGro rp rq ry rz rX rX rX rY r{ c s r{ c @ s e Zd ZdZdZdZdZdZdS )�IntFlagStoogesrk rl ru rv rw Nrx rX rX rX rY r~ n s r~ c @ s$ e Zd ZdZdZdZdZdZdZdS )�IntFlagStoogesWithZeror rk rl ru rv rw Nr| rX rX rX rY r x s r �LifeFormzbranch genus species��modulec @ s e Zd ZdZdZdZdS )� DeathFormr rk rl N)rf rg rh �colorZrigidityZodorrX rX rX rY r� � s r� c @ s e Zd ZdZdZdS )�Name�Guido van RossumzBarry WarsawN)rf rg rh �BDFLZFLUFLrX rX rX rY r� � s r� �Questionzwho what when where why�Answerzhim this then there becausec @ s e Zd Zdd� ZdS )�WhatsItc C s | d S �Nr rX �r` rX rX rY �what� s zWhatsIt.whatN)rf rg rh r� rX rX rX rY r� � s r� c @ s e Zd ZdZdZdS )�ThatsItr rk N)rf rg rh �blahZblehrX rX rX rY r� � s r� c @ s e Zd ZdZdZdZdS )�Fruitrk rl rm N)rf rg rh �tomato�bananaZcherryrX rX rX rY r� � s r� c C s� |\}}g }t ||d �D ]z}z:|d kr@| tt||d��|� n| tt||d��|� W q tk r� t�� dd � \}}|�d||f � Y qX q|r�tdd�|� ��d S )Nrk ��protocolz%2d: %s�Failed with protocols: %s�, ) �ranger: r9 � Exception�sys�exc_info�append� ValueError�join) � assertion�source�targetr� �start�stop�failures�exc�tbrX rX rY �test_pickle_dump_load� s r� c C s� |\}}g }t ||d �D ]R}z| |t||d� W q tk rj t�� d }|�d||jj|f � Y qX q|r�tdd� |� ��d S )Nrk r� z %d: %s %sr� r� ) r� r9 r� r� r� r� re rf r� r� )r� � exception�objr� r� r� r� r� rX rX rY �test_pickle_exception� s r� )� TestEnumV3�TestOrderV3�TestNamedTupleV3�TestStackoverflowAnswersV3�TestIssuesV3�TestExtendEnumV3)�test_v3)�TestEnumV37c @ s e Zd Zddd�Zdd� ZdS )� classpropertyNc C s2 || _ || _|| _|d kr(|d k r(|j}|| _d S �N)�fget�fset�fdel�__doc__)r` r� r� r� �docrX rX rY r_ � s zclassproperty.__init__c C s | � |�S r� )r� )r` �instance� ownerclassrX rX rY �__get__� s zclassproperty.__get__)NNNN)rf rg rh r_ r� rX rX rX rY r� � s r� c @ sp e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� ZdS )� TestOrderz- Test _order_ extra/missing members. c C s G dd� dt �}d S )Nc @ s e Zd ZdZdZdZdZdS )z*TestOrder.test_same_members.<locals>.Color�red green bluerk rl rm N�rf rg rh �_order_�red�green�bluerX rX rX rY �Color� s r� �r �r` r� rX rX rY �test_same_members� s zTestOrder.test_same_membersc C s G dd� dt �}d S )Nc @ s e Zd ZdZdZdZdZeZdS )z7TestOrder.test_same_members_with_aliases.<locals>.Colorr� rk rl rm N�rf rg rh r� r� r� r� �verderX rX rX rY r� � s r� r� r� rX rX rY �test_same_members_with_aliases� s z(TestOrder.test_same_members_with_aliasesc C s, | � td�� G dd� dt�}W 5 Q R X d S )N�#member order does not match _order_c @ s e Zd ZdZdZdZdZdS )z5TestOrder.test_order_has_extra_members.<locals>.Color�red green blue purplerk rl rm Nr� rX rX rX rY r� s r� �r\ � TypeErrorr r� rX rX rY �test_order_has_extra_members� s z&TestOrder.test_order_has_extra_membersc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s e Zd ZdZdZdZdZeZdS )zBTestOrder.test_order_has_extra_members_with_aliases.<locals>.Colorr� rk rl rm Nr� rX rX rX rY r� s r� r� r� rX rX rY �)test_order_has_extra_members_with_aliases s z3TestOrder.test_order_has_extra_members_with_aliasesc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s e Zd ZdZdZdZdZdZdS )z4TestOrder.test_enum_has_extra_members.<locals>.Colorr� rk rl rm ru N�rf rg rh r� r� r� r� �purplerX rX rX rY r� s r� r� r� rX rX rY �test_enum_has_extra_members s z%TestOrder.test_enum_has_extra_membersc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s$ e Zd ZdZdZdZdZdZeZdS )zATestOrder.test_enum_has_extra_members_with_aliases.<locals>.Colorr� rk rl rm ru N� rf rg rh r� r� r� r� r� r� rX rX rX rY r� s r� r� r� rX rX rY �(test_enum_has_extra_members_with_aliases s z2TestOrder.test_enum_has_extra_members_with_aliasesc C s G dd� dt �}d S )Nc @ s e Zd ZdZdZdZdZdS )z/TestOrder.test_same_members_flag.<locals>.Colorr� rk rl ru Nr� rX rX rX rY r� $ s r� �r r� rX rX rY �test_same_members_flag# s z TestOrder.test_same_members_flagc C s G dd� dt �}d S )Nc @ s e Zd ZdZdZdZdZeZdS )z<TestOrder.test_same_members_with_aliases_flag.<locals>.Colorr� rk rl ru Nr� rX rX rX rY r� + s r� r� r� rX rX rY �#test_same_members_with_aliases_flag* s z-TestOrder.test_same_members_with_aliases_flagc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s e Zd ZdZdZdZdZdS )z:TestOrder.test_order_has_extra_members_flag.<locals>.Colorr� rk rl ru Nr� rX rX rX rY r� 4 s r� �r\ r� r r� rX rX rY �!test_order_has_extra_members_flag2 s z+TestOrder.test_order_has_extra_members_flagc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s e Zd ZdZdZdZdZeZdS )zGTestOrder.test_order_has_extra_members_with_aliases_flag.<locals>.Colorr� rk rl ru Nr� rX rX rX rY r� < s r� r� r� rX rX rY �.test_order_has_extra_members_with_aliases_flag: s z8TestOrder.test_order_has_extra_members_with_aliases_flagc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s e Zd ZdZdZdZdZdZdS )z9TestOrder.test_enum_has_extra_members_flag.<locals>.Colorr� rk rl ru � Nr� rX rX rX rY r� E s r� r� r� rX rX rY � test_enum_has_extra_members_flagC s z*TestOrder.test_enum_has_extra_members_flagc C s, | � td�� G dd� dt�}W 5 Q R X d S )Nr� c @ s$ e Zd ZdZdZdZdZdZeZdS )zFTestOrder.test_enum_has_extra_members_with_aliases_flag.<locals>.Colorr� rk rl ru r� Nr� rX rX rX rY r� N s r� r� r� rX rX rY �-test_enum_has_extra_members_with_aliases_flagL s z7TestOrder.test_enum_has_extra_members_with_aliases_flagN)rf rg rh r� r� r� r� r� r� r� r� r� r� r� r� r� rX rX rX rY r� � s r� c @ sD e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dS )� TestAutoValuec C s� G dd� dt �}| �|jjd� G dd� dt�}| �|jd� G dd� dt�}| �|jjd� G d d � d t�}| �|jd� d S )Nc @ s"