403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.230
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_collections.cpython-36.pyc
3

�w2_�(�@sBdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlZddl
Z
ddlmZddlZddlZddlmZmZmZmZddlmZmZmZddlmZddlmZdd	lmZmZdd
lmZmZm Z ddlm!Z!m"Z"m#Z#m$Z$m%Z%ddlm&Z&m'Z'm(Z(m)Z)dd
lm*Z*m+Z+ddlm,Z,m-Z-m.Z.m/Z/m0Z0ddlm1Z1m2Z2ddlm3Z3Gdd�dej4�Z5Gdd�dej4�Z6edd�Z7Gdd�dej4�Z8Gdd�dej4�Z9dd�Z:Gdd�de9�Z;Gdd �d e+�Z<Gd!d"�d"e9�Z=Gd#d$�d$e�Z>Gd%d&�d&e�Z?Gd'd(�d(ej4�Z@d.d)d*�ZAeBd+k�r>eAd,d-�dS)/zUnit tests for collections.py.�N)�choice�	randrange)�support)�
namedtuple�Counter�OrderedDict�_count_elements)�UserDict�
UserString�UserList)�ChainMap)�deque)�	Awaitable�	Coroutine)�
AsyncIterator�
AsyncIterable�AsyncGenerator)�Hashable�Iterable�Iterator�	Generator�
Reversible)�Sized�	Container�Callable�
Collection)�Set�
MutableSet)�Mapping�MutableMapping�KeysView�	ItemsView�
ValuesView)�Sequence�MutableSequence)�
ByteStringc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestUserObjectscCs0|jtt|��tt|��dj|j|jd��dS)Nz&{a} should have all the methods of {b})�a�b)ZassertGreaterEqual�set�dir�format�__name__)�selfr'r(�r.�:/opt/alt/python36/lib64/python3.6/test/test_collections.py�_superset_test!s

zTestUserObjects._superset_testcCs|jtt�dS)N)r0r
�str)r-r.r.r/�test_str_protocol*sz!TestUserObjects.test_str_protocolcCs|jtt�dS)N)r0r�list)r-r.r.r/�test_list_protocol-sz"TestUserObjects.test_list_protocolcCs|jtt�dS)N)r0r	�dict)r-r.r.r/�test_dict_protocol0sz"TestUserObjects.test_dict_protocolN)r,�
__module__�__qualname__r0r2r4r6r.r.r.r/r& s	r&c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestChainMapcCs�t�}d|d<d|d<|j�}d|d<d|d<|j|jddd�ddd	�g�|j|j�tdddd
�j��|jt|�d�xdD]}|j||�q�Wx4tdddd
d�j�D]\}}|j|j|d
�|�q�W|d=|j|jddiddd	�g�|j|j�tdddd
�j��|jt|�d�xdD]}|j||��q Wx6tdddd
d�j�D]\}}|j|j|d
�|��qLW|jt	|�t
|�jdt
|�jdg�x�|j�tj|�fD]�}|j||�|j|j|j�|j
||�|j
|jd|jd�x8t|jdd�|jdd��D]\}}|j||��qW�q�Wx~ttjd�D]l}	tjtj||	��}|j||�|j|j|j�|j
||�x*t|j|j�D]\}}|j
|||��q�W�q>Wxttj|�tt	|��gD]Z}|j||�|j|j|j�|j
||�x*t|j|j�D]\}}|j
|||��qW�q�W|j�}
d|
d<|j|
jddiddiddd	�g�|j|
jjddiddd	�g�|j|
dd�|j|
jdd�dS)N�r'�r(���c)r(r>)r'r()r'r(r>��abc�d)r'r(r>�zz({'c': 30}, {'a': 1, 'b': 2})z({'c': 30}, {'b': 2, 'a': 1})r�)r�	new_child�assertEqual�maps�itemsr5�len�assertIn�get�repr�typer,�copy�assertIsNot�zip�assertIs�range�pickle�HIGHEST_PROTOCOL�loads�dumps�deepcopy�eval�parents)r-r>�d�key�k�v�e�m1�m2�proto�fr.r.r/�test_basics:sf


(
"zTestChainMap.test_basicscCs2|jt�jig�|jtddi�jddig�dS)Nr:r;)rErrF)r-r.r.r/�test_constructorvszTestChainMap.test_constructorcCsH|jt��|jtii��|jtddii��|jtiddi��dS)Nr:r;)�assertFalser�
assertTrue)r-r.r.r/�	test_boolzszTestChainMap.test_boolc	Cs Gdd�dt�}|tddd�tddd��}x0tdddd	d
�j�D]\}}|j|||�q@Wx4tddddd
�j�D]\}}|j|j|d�|�qrWx0tdddd
d
�j�D]\}}|j||k|�q�W|j|jdd�d|�|j|jdd�d�|j|j�d�|jt��|j�WdQRXdS)Nc@seZdZdd�ZdS)z2TestChainMap.test_missing.<locals>.DefaultChainMapcSsdS)Ni�r.)r-rZr.r.r/�__missing__�sz>TestChainMap.test_missing.<locals>.DefaultChainMap.__missing__N)r,r7r8rgr.r.r.r/�DefaultChainMap�srhr:r;)r'r(r<r=)r(r>i�)r'r(r>rY�MTFr'i�i�r()r(r;)	rr5rGrErJ�pop�popitem�assertRaises�KeyError)r-rhrYr[r\r.r.r/�test_missing�szTestChainMap.test_missingcCsVttddd�tddd��}|jt|�tdddd��|jt|j��tdddd��dS)Nr:r;)r'r(r<r=)r(r>)r'r(r>)rr5rErG)r-rYr.r.r/�test_dict_coercion�szTestChainMap.test_dict_coercioncCs�t�}d|d<d|d<ddd�}|j|�}|j|jddd�ddd�g�|j||jd	�Gd
d�dt�}t�}d|d<d|d<|ddd�}|j|�}|j||jd	�xdD]}|j||�q�Wx4tdddd
d�j�D]\}}|j|j|d
�|�q�WdS)z#Tests for changes for issue #16613.r:r'r;r(r<r=)r(r>)r'r(rc@seZdZdd�Zdd�ZdS)z.TestChainMap.test_new_child.<locals>.lowerdictcSst|t�r|j�}tj||�S)N)�
isinstancer1�lowerr5�__getitem__)r-rZr.r.r/rr�s
z:TestChainMap.test_new_child.<locals>.lowerdict.__getitem__cSst|t�r|j�}tj||�S)N)rpr1rqr5�__contains__)r-rZr.r.r/rs�s
z;TestChainMap.test_new_child.<locals>.lowerdict.__contains__N)r,r7r8rrrsr.r.r.r/�	lowerdict�srtr@rA)r'�B�CrBN)	rrDrErFrPr5rIrGrJ)r-r>�mrYrtrZr[r\r.r.r/�test_new_child�s$




zTestChainMap.test_new_childN)	r,r7r8rbrcrfrnrorxr.r.r.r/r98s<r9�TestNTzx y zc@s�eZdZdd�Zejejjdkd�dd��Z	ejejjdkd�dd��Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�TestNamedTuplecCsXtdd�}|j|jd�|j|jf�|j|jt�|j|jtj�|j|jd�|jd|j	�|j
ttdd�|j
ttdd�|j
ttd	d�|j
ttd
d�|j
ttd
d�|j
ttd
d
�|j
ttd
d�|j
ttd
d�tdd�tdd�tdd�}|jdt
|j��tdd�}|jdt
|j��|j
t|jdg�|j
t|jdddg�dS)N�Pointzx y�x�yzclass Point(tuple)zabc%zefg ghi�classZ9abcr@zefg g%hiz	abc classz	8efg 9ghiz_efg ghizefg efg ghiZPoint0zx1 y2�_za b c�ntzthe quick brown foxzu'�the�quick���!)r|r})r�r�)rrEr,�	__slots__r7rr�tuple�_fieldsrI�_sourcerl�
ValueError�assertNotInrK�	TypeError�_make)r-r{r�r.r.r/�test_factory�s.




zTestNamedTuple.test_factoryr;z)Docstrings are omitted with -O2 and abovecCstdd�}|j|jd�dS)Nr{zx yzPoint(x, y))rrE�__doc__)r-r{r.r.r/�test_factory_doc_attr�s
z$TestNamedTuple.test_factory_doc_attrcCs6tdd�}|j|jjd�d|j_|j|jjd�dS)Nr{zx yzAlias for field number 0zdocstring for Point.x)rrEr|r�)r-r{r.r.r/�test_doc_writable�s
z TestNamedTuple.test_doc_writablec	CsRxLddgddgddgddgddgddggD] \}}|jtd|dd�j|�q*WdS)N�efg�g%hi�_1r@r~�8efg�9ghi�_0�_efg�ghi�_2�r|�NTT)�rename)r�r�)r�r�)r@r~)r@r�)r�r�)r�r�)r@r�)r@r�)r@r�r�r�)r@r�r�r�)r@r�r|)r@r�r|)rErr�)r-�specZrenamedr.r.r/�test_name_fixer�szTestNamedTuple.test_name_fixercCs$tdddgtd�}|j|jt�dS)Nr�r|r})�module)r�collectionsrEr7)r-r�r.r.r/�test_module_parameter�sz$TestNamedTuple.test_module_parametercCs�tdd�}|dd�}|j||ddd��|j||ddd��|j||ddd��|j||d��|j||ftddd���|jt|d�|jt|dd	d
�|jttdt��|jttdt��|jt|�d
�|jdt	|��|j||j
ddg��|j|jd�|j|jdd�d�|j|j
�tddd��y|jdd	d�Wntk
�rVYnX|jd�tdd�}|ddd�}|jt|�d
�tdd�}|ddd�}|jt|�d
�dS)Nr{zx yr�r�)r|r})r})r}r|r:r;r?zPoint(XXX=1, y=2)z
Point(x=1)zPoint(x=11, y=22)�__weakref__r|r})r|)r|�errorz%Did not detect an incorrect fieldnamezx, y)r�r�)r|r})r:r�)r|r})rrEr5rlr�rW�localsrKr�r*r�r��_replace�_asdictr�Z_fail)r-r{�pr.r.r/�
test_instance�s8




zTestNamedTuple.test_instancecCs�tdd�}|dd�}|j|t�|j|d	�|jt|�d
�|jt|�ddg�|jt|�d�|jt|�d�|\}}|j|||f�|j|d|dfd�|jt|jd�|j|j	|�|j|j
|�|jttdt
��dS)Nr{zx yr�r�rr:r?zp.z)r�r�)r�r�)r�r�)r�assertIsInstancer�rEr3�maxrl�
IndexErrorrrr|r}�AttributeErrorrWr�)r-r{r�r|r}r.r.r/�test_tuplenesss

zTestNamedTuple.test_tuplenessc
Cs tdd�}|j|�f�|j|jg�f�|jt|��d�|j|�j�i�|j|�jf�tdd�}|j|d�d�|j|jdg�d�|j|d�jd�|jt|d��d�|j|d�j�ddi�|j|d�jdd	�d�|j|d�jd�d
}tt	dd�t
|�D���}t|�}td
|�}|t
|��}|j|tt
|���|j|jt
|��tt
|���x(t
|�D]\}}|jt||�|��qlWt|�|j�}	tt|t
|���}
|j|	|
�|jft|ddf|ddfg��}tt
|��}d|d<d|d<|j|t|��|j|jt|��dS)N�Zeror�zZero()�DotrYr:zDot(d=1)��)rY�css&|]}djdd�td�D��VqdS)r�cSsg|]}ttj��qSr.)r�stringZ
ascii_letters)�.0�jr.r.r/�
<listcomp>Dsz;TestNamedTuple.test_odd_sizes.<locals>.<genexpr>.<listcomp>�
N)�joinrQ)r��ir.r.r/�	<genexpr>Dsz0TestNamedTuple.test_odd_sizes.<locals>.<genexpr>�BigrC�*)r:)r:)r�)rY���r�)rrEr�rKr�r�rYr�r3r)rQrHr��	enumerate�getattrr5rO)
r-r�r��n�namesr�r(�pos�namerYZ
d_expectedZb2Zb2_expectedr.r.r/�test_odd_sizes1sD



$zTestNamedTuple.test_odd_sizescCs�tdddd�}xxtfD]n}t|d�}t|d�}xTtd	|jd�D]@}||||��}|j||�|j|j|j�|jd|||��q@WqWdS)
Nr�r<r=)r|r}rBrTrUr:sOrderedDict���)ryrRr�rQrSrEr�r�)r-r�r�rTrUZprotocol�qr.r.r/�test_pickleXs

zTestNamedTuple.test_picklecCsLtdddd�}x8tjtjfD](}||�}|j||�|j|j|j�qWdS)Nr�r<r=)r|r}rB)ryrMrVrEr�)r-r�Zcopierr�r.r.r/�	test_copycs
zTestNamedTuple.test_copyc
Csztdd�}|ddddd�}|j|d�|jdd	d
ddd
�}|j|d�tj��}tdddd�}WdQRXttjd|j���}|tt	j
�8}td|�}ttt
|���}||�}|j||�|ftt|j|���}|j||�|j|�}|j||�t|�|j|j�tt|j|���|j|�}tdd�|D��}|jftt|j|���}|j||�|j|jt|��|j|j�|�dS)N�Tz"itemgetter property self cls tupler:r;r?�rCr�r<r=�(�2)�
itemgetter�propertyr-�clsr�r|T)�verbosez	[A-Za-z]+css|]}|dVqdS)r�Nr.)r�r\r.r.r/r��sz5TestNamedTuple.test_name_conflicts.<locals>.<genexpr>)r:r;r?r�rC)r�r<r=r�r�)rrEr�r�captured_stdoutr)�re�findall�getvalue�keyword�kwlistr�rQrHr5rOr�r�rKr��__getnewargs__)r-r��tZnewt�template�words�valuesZ	newvaluesr.r.r/�test_name_conflictsjs2




z"TestNamedTuple.test_name_conflictscCs^tj��}tdddd�}WdQRX|jt|d��d�Gdd�d|�}|jt|d��d	�dS)
N�Ar|T)r�r:zA(x=1)c@seZdZdS)z#TestNamedTuple.test_repr.<locals>.BN)r,r7r8r.r.r.r/ru�sruzB(x=1))rr�rrErK)r-r�r�rur.r.r/�	test_repr�s

zTestNamedTuple.test_reprcCsxtdd�}t�jdd�t|jt��|jdt��tddd�}|j|j|j	|j
fd	�|jtjd
�t�jdd�dS)N�NTColorzred green bluer�r<r=�red�green�blue)r�r<r=)r�r�r�)r�globalsrj�execr�rIr�rEr�r�r�r�)r-Ztmpr>r.r.r/�test_source�s
zTestNamedTuple.test_sourcecCs�tj��}tdddgdd�}WdQRX|jd|j�|jt��tdddgd�}WdQRXtdddgdd	�}|j|jd�|jt��tdddgdd�}WdQRXdS)
Nr�r|r}T)r�zclass NTr@�def)r�r�F)r@r�)	rr�rrIr�rlr�rEr�)r-r�r�r.r.r/�test_keyword_only_arguments�s
z*TestNamedTuple.test_keyword_only_argumentscCsXGdd�dtdddg��}|dd�}|j|j�td
dg��d|_|j|jd	di�dS)Nc@seZdZdS)zBTestNamedTuple.test_namedtuple_subclass_issue_24931.<locals>.PointN)r,r7r8r.r.r.r/r{�sr{Z_Pointr|r}r?r�rC�w)r|r?)r}r�)rrEr�rr��__dict__)r-r{r'r.r.r/�$test_namedtuple_subclass_issue_24931�s

z3TestNamedTuple.test_namedtuple_subclass_issue_24931N)r,r7r8r��unittestZskipIf�sys�flags�optimizer�r�r�r�r�r�r�r�r�r�r�r�r�r�r.r.r.r/rz�s"$'&	
rzc@s$eZdZdd�Zdd�Zdd�ZdS)�ABCTestCasecGs`tj|dd��}td|f|�}|�x6|D].}|j�}||=td|f|�}|jt||�q*WdS)NcWsdS)Nrr.)�s�argsr.r.r/�<lambda>�sz7ABCTestCase.validate_abstract_methods.<locals>.<lambda>rv)r5�fromkeysrLrMrlr�)r-r@r�Zmethodstubsrvr�Zstubsr.r.r/�validate_abstract_methods�s
z%ABCTestCase.validate_abstract_methodscCsxdd�}tdtfddi�}t|||�|j|�|�|jt||��tdtfddi�}|j|�|�|jt||��dS)NcWsdS)Nrr.)r�r�r.r.r/r��sz1ABCTestCase.validate_isinstance.<locals>.<lambda>rv�__hash__)rL�object�setattrr�re�
issubclass�assertNotIsInstancerd)r-r@r�Zstubrvr.r.r/�validate_isinstance�szABCTestCase.validate_isinstancec	Cs�ddddddddd	g	}i}x&|D]}d
|d
}tt|�||<q WGdd�d�}xJ|j�D]>\}}t||�snqZ|�}|||�|j|jd
t|�|f�qZWdS)N�lt�gt�le�ge�ne�or�and�xor�sub�__c@s@eZdZdd�Zdd�ZeZeZeZeZeZ	eZ
eZeZeZ
dS)z.ABCTestCase.validate_comparison.<locals>.OthercSs
d|_dS)NF)�
right_side)r-r.r.r/�__init__�sz7ABCTestCase.validate_comparison.<locals>.Other.__init__cSs
d|_dS)NT)r)r-�otherr.r.r/�__eq__�sz5ABCTestCase.validate_comparison.<locals>.Other.__eq__N)r,r7r8rr�__lt__�__gt__�__le__�__ge__�__ne__�__ror__�__rand__�__rxor__�__rsub__r.r.r.r/�Other�srzRight side not called for %s.%s)r��operatorrG�hasattrrerrL)r-�instanceZopsZ	operators�opr�rrr.r.r/�validate_comparison�s



zABCTestCase.validate_comparisonN)r,r7r8r�r�rr.r.r.r/r��sr�ccs
dVdS)Nr.r.r.r.r/�	_test_gen�src@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�TestOneTrickPonyABCscCs6dd�}tjdd��}dd�}Gdd�d�}Gd	d
�d
t�}dt�|�t�g}x6|D].}|j|t�|jtt	|�t�t
t	|���qTW|�|�g}x,|D]$}|j|t�|jtt	|�t��q�W|�}	|j|	t�|�}	|j|	t�|	j
�Gdd�d�}
tj|
�|jt|
�t��|jt|
t��d}
tj�dS)
Ncss
dVdS)Nr.r.r.r.r/�gensz0TestOneTrickPonyABCs.test_Awaitable.<locals>.gencss
dVdS)Nr.r.r.r.r/�corosz1TestOneTrickPonyABCs.test_Awaitable.<locals>.coroc�sdS)Nr.r.r.r.r/�new_corosz5TestOneTrickPonyABCs.test_Awaitable.<locals>.new_coroc@seZdZdd�ZdS)z0TestOneTrickPonyABCs.test_Awaitable.<locals>.Barcss
dVdS)Nr.)r-r.r.r/�	__await__sz:TestOneTrickPonyABCs.test_Awaitable.<locals>.Bar.__await__N)r,r7r8rr.r.r.r/�Barsrcs.eZdZdd�Zd�fdd�	Zdd�Z�ZS)	z8TestOneTrickPonyABCs.test_Awaitable.<locals>.MinimalCorocSs|S)Nr.)r-�valuer.r.r/�sendsz=TestOneTrickPonyABCs.test_Awaitable.<locals>.MinimalCoro.sendNcst�j|||�dS)N)�super�throw)r-�typ�val�tb)�	__class__r.r/r"sz>TestOneTrickPonyABCs.test_Awaitable.<locals>.MinimalCoro.throwcss
dVdS)Nr.)r-r.r.r/rszBTestOneTrickPonyABCs.test_Awaitable.<locals>.MinimalCoro.__await__)NN)r,r7r8r r"r�
__classcell__r.r.)r&r/�MinimalCorosr(c@seZdZdS)z5TestOneTrickPonyABCs.test_Awaitable.<locals>.CoroLikeN)r,r7r8r.r.r.r/�CoroLike+sr))�types�	coroutiner�intr�r�rrdr�rLrKr�re�close�registerrprZ
gc_collect)r-rrrrr(�non_samplesr|�samplesr>r)r.r.r/�test_Awaitables0
"

z#TestOneTrickPonyABCs.test_AwaitablecCsPdd�}tjdd��}dd�}Gdd�d�}Gd	d
�d
t�}dt�|�t�|�g}x6|D].}|j|t�|jtt|�t�t	t|���qXW|�g}x,|D]$}|j
|t�|jtt|�t��q�W|�}	|j|	t�|�}	|j
|	t�|	j
�Gdd�d�}
|jt|
�t��|jt|
t��Gd
d�d�}
|jt|
�t��|jt|
t��dS)Ncss
dVdS)Nr.r.r.r.r/r3sz0TestOneTrickPonyABCs.test_Coroutine.<locals>.gencss
dVdS)Nr.r.r.r.r/r6sz1TestOneTrickPonyABCs.test_Coroutine.<locals>.coroc�sdS)Nr.r.r.r.r/r:sz5TestOneTrickPonyABCs.test_Coroutine.<locals>.new_coroc@seZdZdd�ZdS)z0TestOneTrickPonyABCs.test_Coroutine.<locals>.Barcss
dVdS)Nr.)r-r.r.r/r>sz:TestOneTrickPonyABCs.test_Coroutine.<locals>.Bar.__await__N)r,r7r8rr.r.r.r/r=srcs.eZdZdd�Zd�fdd�	Zdd�Z�ZS)	z8TestOneTrickPonyABCs.test_Coroutine.<locals>.MinimalCorocSs|S)Nr.)r-rr.r.r/r Bsz=TestOneTrickPonyABCs.test_Coroutine.<locals>.MinimalCoro.sendNcst�j|||�dS)N)r!r")r-r#r$r%)r&r.r/r"Dsz>TestOneTrickPonyABCs.test_Coroutine.<locals>.MinimalCoro.throwcss
dVdS)Nr.)r-r.r.r/rFszBTestOneTrickPonyABCs.test_Coroutine.<locals>.MinimalCoro.__await__)NN)r,r7r8r r"rr'r.r.)r&r/r(Asr(c@s.eZdZdd�Zd
dd�Zdd�Zdd	�ZdS)z5TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLikecSsdS)Nr.)r-rr.r.r/r ^sz:TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.sendNcSsdS)Nr.)r-r#r$r%r.r.r/r"`sz;TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.throwcSsdS)Nr.)r-r.r.r/r-bsz;TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.closecSsdS)Nr.)r-r.r.r/rdsz?TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.__await__)NN)r,r7r8r r"r-rr.r.r.r/r)]s
r)c@s$eZdZdd�Zdd�Zdd�ZdS)z5TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLikecSsdS)Nr.)r-rr.r.r/r jsz:TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.sendcSsdS)Nr.)r-r.r.r/r-lsz;TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.closecSsdS)Nr.)r-r.r.r/rnsz?TestOneTrickPonyABCs.test_Coroutine.<locals>.CoroLike.__await__N)r,r7r8r r-rr.r.r.r/r)is)r*r+rr,r�r�rdr�rLrKr�rrer-rp)r-rrrrr(r/r|r0r>r)r.r.r/�test_Coroutine2s0
"
	z#TestOneTrickPonyABCs.test_CoroutinecCst�t�t�t�g}x6|D].}|j|t�|jtt|�t�t	t|���qWdt
�t�t�t
�t�t�t
tttt�g}x6|D].}|j|t�|jtt|�t�t	t|���q|W|jtt�Gdd�dt�}|jt|��d�|jtt
|��|jtd�|jtd�dS)NcseZdZ�fdd�Z�ZS)z-TestOneTrickPonyABCs.test_Hashable.<locals>.Hcs
t�j�S)N)r!r�)r-)r&r.r/r��sz6TestOneTrickPonyABCs.test_Hashable.<locals>.H.__hash__)r,r7r8r�r'r.r.)r&r/�H�sr3rr�)�	bytearrayr3r)r5r�rrdr�rLrKr,�float�complexr1r��	frozensetr��bytesr�rerlr�rE�hashr�r�)r-r/r|r0r3r.r.r/�
test_Hashabless$
"
"z"TestOneTrickPonyABCs.test_HashablecCs�Gdd�d�}|jt|�t��|jt|t��dtgg}x6|D].}|j|t�|jtt|�t�tt|���q@W|j	td�|j
td�dS)Nc@seZdZdd�ZdS)z3TestOneTrickPonyABCs.test_AsyncIterable.<locals>.AIc�s|S)Nr.)r-r.r.r/�	__aiter__�sz=TestOneTrickPonyABCs.test_AsyncIterable.<locals>.AI.__aiter__N)r,r7r8r;r.r.r.r/�AI�sr<r;)rerprr�r�r�rdrLrKr�r�)r-r<r/r|r.r.r/�test_AsyncIterable�s

"z'TestOneTrickPonyABCs.test_AsyncIterablecCs�Gdd�d�}|jt|�t��|jt|t��dtgg}x6|D].}|j|t�|jtt|�t�tt|���q@WGdd�d�}|j|�t�|j	tdd�dS)Nc@seZdZdd�Zdd�ZdS)z3TestOneTrickPonyABCs.test_AsyncIterator.<locals>.AIc�s|S)Nr.)r-r.r.r/r;�sz=TestOneTrickPonyABCs.test_AsyncIterator.<locals>.AI.__aiter__c�st�dS)N)�StopAsyncIteration)r-r.r.r/�	__anext__�sz=TestOneTrickPonyABCs.test_AsyncIterator.<locals>.AI.__anext__N)r,r7r8r;r?r.r.r.r/r<�sr<c@seZdZdd�ZdS)z:TestOneTrickPonyABCs.test_AsyncIterator.<locals>.AnextOnlyc�st�dS)N)r>)r-r.r.r/r?�szDTestOneTrickPonyABCs.test_AsyncIterator.<locals>.AnextOnly.__anext__N)r,r7r8r?r.r.r.r/�	AnextOnly�sr@r?r;)
rerprr�r�r�rdrLrKr�)r-r<r/r|r@r.r.r/�test_AsyncIterator�s

"z'TestOneTrickPonyABCs.test_AsyncIteratorc
Cstddddg}x6|D].}|j|t�|jtt|�t�tt|���qWt�t�t�t	�t
�t�t�t�j
�t�j�t�j�t�dd�gD�g}x6|D].}|j|t�|jtt|�t�tt|���q�WGdd�dt�}|jt	|��g�|jtt|��|jtd�|jtd�Gd	d
�d
�}Gdd�d|�}|jt|t��|jt|�t��|jt|t��|jt|�t��dS)
Nr�g��Q�	@y�?css|]
}|VqdS)Nr.)r�r|r.r.r/r��sz5TestOneTrickPonyABCs.test_Iterable.<locals>.<genexpr>cseZdZ�fdd�Z�ZS)z-TestOneTrickPonyABCs.test_Iterable.<locals>.Ics
t�j�S)N)r!�__iter__)r-)r&r.r/rB�sz6TestOneTrickPonyABCs.test_Iterable.<locals>.I.__iter__)r,r7r8rBr'r.r.)r&r/�I�srCrBc@seZdZdd�ZdS)z.TestOneTrickPonyABCs.test_Iterable.<locals>.ItcSstg�S)N)�iter)r-r.r.r/rB�sz7TestOneTrickPonyABCs.test_Iterable.<locals>.It.__iter__N)r,r7r8rBr.r.r.r/�It�srEc@seZdZdZdS)z5TestOneTrickPonyABCs.test_Iterable.<locals>.ItBlockedN)r,r7r8rBr.r.r.r/�	ItBlocked�srF)r�rrdr�rLrKr8r1r�r3r)r7r5�keysrGr�rr�rerEr�r�rp)r-r/r|r0rCrErFr.r.r/�
test_Iterable�s.
"
"z"TestOneTrickPonyABCs.test_IterablecCs�ddddt�t�t�g}x6|D].}|j|t�|jtt|�t�tt|���qWt�j	�t�j
�t�j�t�t�j	�t�j
�t�j�t
�dd�gD�tg�tg�g}x6|D].}|j|t�|jtt|�t�tt|���q�Wt�t�t�t�t�t�j	�t�j
�t�j�g}x8|D]0}|j|t�|jtt|�t�tt|����qW|jttt�tt��|jttt�tt��|jttt�tt��Gdd�dt�}|jtt|���g�|jtt|��|jtdd	�Gd
d�d�}Gdd
�d
|�}|jt|t��|jt|�t��|jt|t��|jt|�t��Gdd�d�}Gdd�d|�}	Gdd�d|�}
|jt|t��|jt|�t��|jt|	t��|jt|	�t��|jt|
t��|jt|
�t��dS)Nr�g��Q�	@y�?css|]
}|VqdS)Nr.)r�r|r.r.r/r��sz7TestOneTrickPonyABCs.test_Reversible.<locals>.<genexpr>c@seZdZdd�Zdd�ZdS)z/TestOneTrickPonyABCs.test_Reversible.<locals>.RcSs
tt��S)N)rDr3)r-r.r.r/rB�sz8TestOneTrickPonyABCs.test_Reversible.<locals>.R.__iter__cSs
tt��S)N)rDr3)r-r.r.r/�__reversed__�sz<TestOneTrickPonyABCs.test_Reversible.<locals>.R.__reversed__N)r,r7r8rBrIr.r.r.r/�R�srJrIrBc@seZdZdd�ZdS)z7TestOneTrickPonyABCs.test_Reversible.<locals>.RevNoItercSstg�S)N)�reversed)r-r.r.r/rI�szDTestOneTrickPonyABCs.test_Reversible.<locals>.RevNoIter.__reversed__N)r,r7r8rIr.r.r.r/�	RevNoIter�srLc@seZdZdd�ZdS)z9TestOneTrickPonyABCs.test_Reversible.<locals>.RevPlusItercSstg�S)N)rD)r-r.r.r/rB�szBTestOneTrickPonyABCs.test_Reversible.<locals>.RevPlusIter.__iter__N)r,r7r8rBr.r.r.r/�RevPlusIter�srMc@seZdZdd�Zdd�ZdS)z1TestOneTrickPonyABCs.test_Reversible.<locals>.RevcSstg�S)N)rD)r-r.r.r/rB�sz:TestOneTrickPonyABCs.test_Reversible.<locals>.Rev.__iter__cSstg�S)N)rK)r-r.r.r/rI�sz>TestOneTrickPonyABCs.test_Reversible.<locals>.Rev.__reversed__N)r,r7r8rBrIr.r.r.r/�Rev�srNc@seZdZdZdS)z:TestOneTrickPonyABCs.test_Reversible.<locals>.RevItBlockedN)r,r7r8rBr.r.r.r/�RevItBlockedsrOc@seZdZdZdS)z;TestOneTrickPonyABCs.test_Reversible.<locals>.RevRevBlockedN)r,r7r8rIr.r.r.r/�
RevRevBlockedsrP)r5r)r7r�rrdr�rLrKrGrGr�rrrDrKr8r1r�r3rr�rer#rrrEr5r�rp)r-r/r|Znon_reversiblesr0rJrLrMrNrOrPr.r.r/�test_Reversible�sN
"
"
$z$TestOneTrickPonyABCs.test_Reversiblec	Cs�dddddd�g}x6|D].}|j|t�|jtt|�t�tt|���qWt�td�tt��dd�gD�t	�j
�g}x6|D].}|j|t�|jtt|�t�tt|���qzWt�t�t	�t
�t�t�t�t	�j�t	�j�g	}x6|D].}|j|t�|jtt|�t�tt|���q�W|jttt�tt��|jttt�tt��|jttt�tt��|jttt�tt��|jttt�tt��|jttt�tt��Gd	d
�d
t�}Gdd�d|�}|jtt|���g�|jtt|��|jtt|��|jtt|��|jtt|���g�|jtt|��|jtt|��|jtt|��|jtd
dd�Gdd�d�}Gdd�d�}Gdd�d�}	|jt|t��|jt|�t��|jt|t��|jt|�t��|jt|	t��|jt|	�t��Gdd�d�}
Gdd�d�}|jt|
t��|jt|
�t��|jt|t��|jt|�t��Gdd�d�}Gdd�d|�}
|jt|
t��|jt|
�t��dS)Nr�g��Q�	@y�?cSsd|S)Nr;r.)r|r.r.r/r�
sz6TestOneTrickPonyABCs.test_Collection.<locals>.<lambda>�css|]
}|VqdS)Nr.)r�r|r.r.r/r�sz7TestOneTrickPonyABCs.test_Collection.<locals>.<genexpr>c@s$eZdZdd�Zdd�Zdd�ZdS)z1TestOneTrickPonyABCs.test_Collection.<locals>.ColcSs
tt��S)N)rDr3)r-r.r.r/rB'sz:TestOneTrickPonyABCs.test_Collection.<locals>.Col.__iter__cSsdS)Nrr.)r-r.r.r/�__len__)sz9TestOneTrickPonyABCs.test_Collection.<locals>.Col.__len__cSsdS)NFr.)r-�itemr.r.r/rs+sz>TestOneTrickPonyABCs.test_Collection.<locals>.Col.__contains__N)r,r7r8rBrSrsr.r.r.r/�Col&srUc@seZdZdS)z4TestOneTrickPonyABCs.test_Collection.<locals>.DerColN)r,r7r8r.r.r.r/�DerCol-srVrSrBrsc@seZdZdd�Zdd�ZdS)z7TestOneTrickPonyABCs.test_Collection.<locals>.ColNoItercSsdS)Nrr.)r-r.r.r/rS:sz?TestOneTrickPonyABCs.test_Collection.<locals>.ColNoIter.__len__cSsdS)NFr.)r-rTr.r.r/rs;szDTestOneTrickPonyABCs.test_Collection.<locals>.ColNoIter.__contains__N)r,r7r8rSrsr.r.r.r/�	ColNoIter9srWc@seZdZdd�Zdd�ZdS)z7TestOneTrickPonyABCs.test_Collection.<locals>.ColNoSizecSstg�S)N)rD)r-r.r.r/rB=sz@TestOneTrickPonyABCs.test_Collection.<locals>.ColNoSize.__iter__cSsdS)NFr.)r-rTr.r.r/rs>szDTestOneTrickPonyABCs.test_Collection.<locals>.ColNoSize.__contains__N)r,r7r8rBrsr.r.r.r/�	ColNoSize<srXc@seZdZdd�Zdd�ZdS)z7TestOneTrickPonyABCs.test_Collection.<locals>.ColNoContcSstg�S)N)rD)r-r.r.r/rB@sz@TestOneTrickPonyABCs.test_Collection.<locals>.ColNoCont.__iter__cSsdS)Nrr.)r-r.r.r/rSAsz?TestOneTrickPonyABCs.test_Collection.<locals>.ColNoCont.__len__N)r,r7r8rBrSr.r.r.r/�	ColNoCont?srYc@s eZdZdd�Zdd�ZdZdS)z7TestOneTrickPonyABCs.test_Collection.<locals>.SizeBlockcSstg�S)N)rD)r-r.r.r/rBJsz@TestOneTrickPonyABCs.test_Collection.<locals>.SizeBlock.__iter__cSsdS)NFr.)r-r.r.r/rsKszDTestOneTrickPonyABCs.test_Collection.<locals>.SizeBlock.__contains__N)r,r7r8rBrsrSr.r.r.r/�	SizeBlockIsrZc@s eZdZdd�Zdd�ZdZdS)z7TestOneTrickPonyABCs.test_Collection.<locals>.IterBlockcSsdS)Nrr.)r-r.r.r/rSNsz?TestOneTrickPonyABCs.test_Collection.<locals>.IterBlock.__len__cSsdS)NTr.)r-r.r.r/rsOszDTestOneTrickPonyABCs.test_Collection.<locals>.IterBlock.__contains__N)r,r7r8rSrsrBr.r.r.r/�	IterBlockMsr[c@s$eZdZdd�Zdd�Zdd�ZdS)z5TestOneTrickPonyABCs.test_Collection.<locals>.ColImplcSs
tt��S)N)rDr3)r-r.r.r/rBWsz>TestOneTrickPonyABCs.test_Collection.<locals>.ColImpl.__iter__cSsdS)Nrr.)r-r.r.r/rSYsz=TestOneTrickPonyABCs.test_Collection.<locals>.ColImpl.__len__cSsdS)NFr.)r-rTr.r.r/rs[szBTestOneTrickPonyABCs.test_Collection.<locals>.ColImpl.__contains__N)r,r7r8rBrSrsr.r.r.r/�ColImplVsr\c@seZdZdZdS)z4TestOneTrickPonyABCs.test_Collection.<locals>.NonColN)r,r7r8rsr.r.r.r/�NonCol]sr])r�rrdr�rLrKrrDr4r5r�r)r7r8r1r�r3rGrGr�rer#rrrrrEr5r�rp)r-Znon_collectionsr|Znon_col_iterablesr0rUrVrWrXrYrZr[r\r]r.r.r/�test_Collectionsh
"
"
"

z$TestOneTrickPonyABCs.test_Collectionc
Cs(ddddddfgit�g
}x6|D].}|j|t�|jtt|�t�tt|���q Wtt��tt	��tt
��tt��tt��tt��tt
��tt�j��tt�j��tt�j��t�dd�gD�g}x6|D].}|j|t�|jtt|�t�tt|���q�W|jtdd	�Gd
d�d�}|j|�t�dS)Nr�g��Q�	@y�?rRr�css|]
}|VqdS)Nr.)r�r|r.r.r/r�nsz5TestOneTrickPonyABCs.test_Iterator.<locals>.<genexpr>�__next__rBc@seZdZdd�ZdS)z4TestOneTrickPonyABCs.test_Iterator.<locals>.NextOnlycss
dVdS)Nr:r.)r-r.r.r/r_wsz=TestOneTrickPonyABCs.test_Iterator.<locals>.NextOnly.__next__N)r,r7r8r_r.r.r.r/�NextOnlyvsr`)r)r�rrdr�rLrKrDr8r1r�r3r5r7rGrGr�rr�rer�)r-r/r|r0r`r.r.r/�
test_Iteratorcs"
"
"z"TestOneTrickPonyABCs.test_Iteratorc
Cs�Gdd�d�}Gdd�d�}Gdd�d�}dddd	d
dfgit�tf�tg�|�|�|�g}x6|D].}|j|t�|jtt|�t�tt|���qbWGdd
�d
�}Gdd�dt�}dd�}|�dd��|�|�g}	xB|	D]:}|j|t	�|j|t�|j
tt|�t�tt|���q�W|jtdd�|�}
|j|
t|
��|j|
j
d�t|
��|jd|
j
d��|j|
j��|jt|
jt�|jtd|
jttd��|jt|
jt��Gdd�dt�}|jt|�j�Gdd�dt�}|jt|�j�dS)Nc@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)z4TestOneTrickPonyABCs.test_Generator.<locals>.NonGen1cSs|S)Nr.)r-r.r.r/rB~sz=TestOneTrickPonyABCs.test_Generator.<locals>.NonGen1.__iter__cSsdS)Nr.)r-r.r.r/r_sz=TestOneTrickPonyABCs.test_Generator.<locals>.NonGen1.__next__cSsdS)Nr.)r-r.r.r/r-�sz:TestOneTrickPonyABCs.test_Generator.<locals>.NonGen1.closeNcSsdS)Nr.)r-r#r$r%r.r.r/r"�sz:TestOneTrickPonyABCs.test_Generator.<locals>.NonGen1.throw)NN)r,r7r8rBr_r-r"r.r.r.r/�NonGen1}srbc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z4TestOneTrickPonyABCs.test_Generator.<locals>.NonGen2cSs|S)Nr.)r-r.r.r/rB�sz=TestOneTrickPonyABCs.test_Generator.<locals>.NonGen2.__iter__cSsdS)Nr.)r-r.r.r/r_�sz=TestOneTrickPonyABCs.test_Generator.<locals>.NonGen2.__next__cSsdS)Nr.)r-r.r.r/r-�sz:TestOneTrickPonyABCs.test_Generator.<locals>.NonGen2.closecSs|S)Nr.)r-rr.r.r/r �sz9TestOneTrickPonyABCs.test_Generator.<locals>.NonGen2.sendN)r,r7r8rBr_r-r r.r.r.r/�NonGen2�srcc@s&eZdZdd�Zdd�Zddd�ZdS)	z4TestOneTrickPonyABCs.test_Generator.<locals>.NonGen3cSsdS)Nr.)r-r.r.r/r-�sz:TestOneTrickPonyABCs.test_Generator.<locals>.NonGen3.closecSs|S)Nr.)r-rr.r.r/r �sz9TestOneTrickPonyABCs.test_Generator.<locals>.NonGen3.sendNcSsdS)Nr.)r-r#r$r%r.r.r/r"�sz:TestOneTrickPonyABCs.test_Generator.<locals>.NonGen3.throw)NN)r,r7r8r-r r"r.r.r.r/�NonGen3�srdr�g��Q�	@y�?rRr�c@s6eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zd	S)
z0TestOneTrickPonyABCs.test_Generator.<locals>.GencSs|S)Nr.)r-r.r.r/rB�sz9TestOneTrickPonyABCs.test_Generator.<locals>.Gen.__iter__cSsdS)Nr.)r-r.r.r/r_�sz9TestOneTrickPonyABCs.test_Generator.<locals>.Gen.__next__cSsdS)Nr.)r-r.r.r/r-�sz6TestOneTrickPonyABCs.test_Generator.<locals>.Gen.closecSs|S)Nr.)r-rr.r.r/r �sz5TestOneTrickPonyABCs.test_Generator.<locals>.Gen.sendNcSsdS)Nr.)r-r#r$r%r.r.r/r"�sz6TestOneTrickPonyABCs.test_Generator.<locals>.Gen.throw)NN)r,r7r8rBr_r-r r"r.r.r.r/�Gen�s
recs&eZdZdd�Zd�fdd�	Z�ZS)z7TestOneTrickPonyABCs.test_Generator.<locals>.MinimalGencSs|S)Nr.)r-rr.r.r/r �sz<TestOneTrickPonyABCs.test_Generator.<locals>.MinimalGen.sendNcst�j|||�dS)N)r!r")r-r#r$r%)r&r.r/r"�sz=TestOneTrickPonyABCs.test_Generator.<locals>.MinimalGen.throw)NN)r,r7r8r r"r'r.r.)r&r/�
MinimalGen�srfcss
dVdS)Nr:r.r.r.r.r/r�sz0TestOneTrickPonyABCs.test_Generator.<locals>.gencssdVS)Nr.r.r.r.r/r��sz5TestOneTrickPonyABCs.test_Generator.<locals>.<lambda>r r"r;z^huhu$Zhuhuc@seZdZdd�Zdd�ZdS)z8TestOneTrickPonyABCs.test_Generator.<locals>.FailOnClosecSs|S)Nr.)r-rr.r.r/r �sz=TestOneTrickPonyABCs.test_Generator.<locals>.FailOnClose.sendcWst�dS)N)r�)r-r�r.r.r/r"�sz>TestOneTrickPonyABCs.test_Generator.<locals>.FailOnClose.throwN)r,r7r8r r"r.r.r.r/�FailOnClose�srgc@seZdZdd�Zdd�ZdS)z@TestOneTrickPonyABCs.test_Generator.<locals>.IgnoreGeneratorExitcSs|S)Nr.)r-rr.r.r/r �szETestOneTrickPonyABCs.test_Generator.<locals>.IgnoreGeneratorExit.sendcWsdS)Nr.)r-r�r.r.r/r"�szFTestOneTrickPonyABCs.test_Generator.<locals>.IgnoreGeneratorExit.throwN)r,r7r8r r"r.r.r.r/�IgnoreGeneratorExit�srh)r)rDr�rrdr�rLrKr�rrer�rPr �nextrE�assertIsNoner-rlr�r"ZassertRaisesRegex�
StopIteration�RuntimeError)
r-rbrcrdr/r|rerfrr0�mgenrgrhr.r.r/�test_Generator|s<
"
"z#TestOneTrickPonyABCs.test_GeneratorcCsGdd�d�}Gdd�d�}Gdd�d�}dddd	d
dfgit�tf�tg�|�|�|�g}x6|D].}|j|t�|jtt|�t�tt|���qbWGdd
�d
�}Gdd�dt�}dd�}|�|�|�g}	xB|	D]:}|j|t	�|j|t�|j
tt|�t�tt|���q�W|jtdd�dd�}
|�}|j||j
��|j|
|jd��|
|j���|jd|
|jd���|j|
|j���|jt��|
|jt��WdQRXGdd�dt�}|jt��|
|�j��WdQRXGdd�dt�}
|jt��|
|
�j��WdQRXdS)Nc@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)z:TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen1cSs|S)Nr.)r-r.r.r/r;�szDTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen1.__aiter__cSsdS)Nr.)r-r.r.r/r?�szDTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen1.__anext__cSsdS)Nr.)r-r.r.r/�aclose�szATestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen1.acloseNcSsdS)Nr.)r-r#r$r%r.r.r/�athrow�szATestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen1.athrow)NN)r,r7r8r;r?rorpr.r.r.r/�NonAGen1�srqc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z:TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen2cSs|S)Nr.)r-r.r.r/r;�szDTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen2.__aiter__cSsdS)Nr.)r-r.r.r/r?�szDTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen2.__anext__cSsdS)Nr.)r-r.r.r/ro�szATestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen2.aclosecSs|S)Nr.)r-rr.r.r/�asend�sz@TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen2.asendN)r,r7r8r;r?rorrr.r.r.r/�NonAGen2�srsc@s&eZdZdd�Zdd�Zddd�ZdS)	z:TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen3cSsdS)Nr.)r-r.r.r/ro�szATestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen3.aclosecSs|S)Nr.)r-rr.r.r/rr�sz@TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen3.asendNcSsdS)Nr.)r-r#r$r%r.r.r/rp�szATestOneTrickPonyABCs.test_AsyncGenerator.<locals>.NonAGen3.athrow)NN)r,r7r8rorrrpr.r.r.r/�NonAGen3�srtr�g��Q�	@y�?rRr�c@s6eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zd	S)
z5TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.GencSs|S)Nr.)r-r.r.r/r;�sz?TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.Gen.__aiter__c�sdS)Nr.)r-r.r.r/r?�sz?TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.Gen.__anext__c�sdS)Nr.)r-r.r.r/ro�sz<TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.Gen.aclosec�s|S)Nr.)r-rr.r.r/rr�sz;TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.Gen.asendNc�sdS)Nr.)r-r#r$r%r.r.r/rp�sz<TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.Gen.athrow)NN)r,r7r8r;r?rorrrpr.r.r.r/re�s
recs&eZdZdd�Zd�fdd�	Z�ZS)z=TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.MinimalAGenc�s|S)Nr.)r-rr.r.r/rr�szCTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.MinimalAGen.asendNc�st�j|||�IdHdS)N)r!rp)r-r#r$r%)r&r.r/rp�szDTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.MinimalAGen.athrow)NN)r,r7r8rrrpr'r.r.)r&r/�MinimalAGen�srucSs
dVdS)Nr:r.r.r.r.r/r�sz5TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.genrrrpcSsVd}xLy|jd�Wqtk
rL}z|jr6|jdnd}PWYdd}~XqXqW|S)Nr)r rkr�)r�resultZexr.r.r/�	run_async�sz;TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.run_asyncr;c@seZdZdd�Zdd�ZdS)z=TestOneTrickPonyABCs.test_AsyncGenerator.<locals>.FailOnClosec�s|S)Nr.)r-rr.r.r/rrszCTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.FailOnClose.asendc�st�dS)N)r�)r-r�r.r.r/rpszDTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.FailOnClose.athrowN)r,r7r8rrrpr.r.r.r/rgsrgc@seZdZdd�Zdd�ZdS)zETestOneTrickPonyABCs.test_AsyncGenerator.<locals>.IgnoreGeneratorExitc�s|S)Nr.)r-rr.r.r/rrszKTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.IgnoreGeneratorExit.asendc�sdS)Nr.)r-r�r.r.r/rpszLTestOneTrickPonyABCs.test_AsyncGenerator.<locals>.IgnoreGeneratorExit.athrowN)r,r7r8rrrpr.r.r.r/rh
srh)r)rDr�rrdr�rLrKr�rrer�rPr;rrr?rErjrorlr�rprl)r-rqrsrtr/r|rerurr0rwrmrgrhr.r.r/�test_AsyncGenerator�s>
"
"z(TestOneTrickPonyABCs.test_AsyncGeneratorc
Cs�ddddt�dd�gD�g}x6|D].}|j|t�|jtt|�t�tt|���q"Wt�t�t	�t
�t�t�t
�t
�j�t
�j�t
�j�g
}x6|D].}|j|t�|jtt|�t�tt|���q�W|jtd�|jtd�dS)Nr�g��Q�	@y�?css|]
}|VqdS)Nr.)r�r|r.r.r/r�sz2TestOneTrickPonyABCs.test_Sized.<locals>.<genexpr>rS)rr�rrdr�rLrKr8r1r�r3r)r7r5rGrGr�r�rer�r�)r-r/r|r0r.r.r/�
test_Sizeds
"
"zTestOneTrickPonyABCs.test_Sizedc	Cs�ddddt�dd�gD�g}x6|D].}|j|t�|jtt|�t�tt|���q"Wt�t�t	�t
�t�t�t
�t
�j�t
�j�g	}x6|D].}|j|t�|jtt|�t�tt|���q�W|jtd�|jtd�dS)Nr�g��Q�	@y�?css|]
}|VqdS)Nr.)r�r|r.r.r/r�)sz6TestOneTrickPonyABCs.test_Container.<locals>.<genexpr>rs)rr�rrdr�rLrKr8r1r�r3r)r7r5rGrGr�rer�r�)r-r/r|r0r.r.r/�test_Container&s
"
"z#TestOneTrickPonyABCs.test_Containerc
Cs�ddddddfgit�t�dd�gD�g}x6|D].}|j|t�|jtt|�t�tt|���q0Wdd	�ttt	t
tjgjg}x6|D].}|j
|t�|jtt|�t�tt|���q�W|jtd
�|jtd
�dS)Nr�g��Q�	@y�?r�rRcss|]
}|VqdS)Nr.)r�r|r.r.r/r�<sz5TestOneTrickPonyABCs.test_Callable.<locals>.<genexpr>cSsdS)Nr.r.r.r.r/r�Asz4TestOneTrickPonyABCs.test_Callable.<locals>.<lambda>�__call__)r)rr�rrdr�rLrKr,r�rHr3�appendr�rer�r�)r-r/r|r0r.r.r/�
test_Callable8s 
"
"z"TestOneTrickPonyABCs.test_CallablecCsPxJtttttttfD]4}Gdd�d|�}|jt||��|j	tt
|��qWdS)Nc@seZdZdS)z7TestOneTrickPonyABCs.test_direct_subclassing.<locals>.CN)r,r7r8r.r.r.r/rvNsrv)rrrrrrrrer�rdr,)r-rurvr.r.r/�test_direct_subclassingLsz,TestOneTrickPonyABCs.test_direct_subclassingcCs\xVtttttttfD]@}Gdd�d�}|jt||�|j	�|j
|�|jt||��qWdS)Nc@seZdZdZdS)z1TestOneTrickPonyABCs.test_registration.<locals>.CN)r,r7r8r�r.r.r.r/rvUsrv)rrrrrrrrdr�r,r.re)r-rurvr.r.r/�test_registrationSs

z&TestOneTrickPonyABCs.test_registrationN)r,r7r8r1r2r:r=rArHrQr^rarnrxryrzr}r~rr.r.r.r/r�s 2A":XGQrc@s@eZdZffdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�WithSetcCst|�|_dS)N)r)�data)r-�itr.r.r/r]szWithSet.__init__cCs
t|j�S)N)rHr�)r-r.r.r/rS`szWithSet.__len__cCs
t|j�S)N)rDr�)r-r.r.r/rBcszWithSet.__iter__cCs
||jkS)N)r�)r-rTr.r.r/rsfszWithSet.__contains__cCs|jj|�dS)N)r��add)r-rTr.r.r/r�iszWithSet.addcCs|jj|�dS)N)r��discard)r-rTr.r.r/r�lszWithSet.discardN)	r,r7r8rrSrBrsr�r�r.r.r.r/r�[sr�c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+S),�TestCollectionABCscCs`x.ttgD]"}|j|�t�|jt|t��q
W|jtddd�Gdd�dt�}|j|��dS)NrsrBrSc@s$eZdZdd�Zdd�Zdd�ZdS)z*TestCollectionABCs.test_Set.<locals>.MySetcSsdS)NFr.)r-r|r.r.r/rs{sz7TestCollectionABCs.test_Set.<locals>.MySet.__contains__cSsdS)Nrr.)r-r.r.r/rS}sz2TestCollectionABCs.test_Set.<locals>.MySet.__len__cSstg�S)N)rD)r-r.r.r/rBsz3TestCollectionABCs.test_Set.<locals>.MySet.__iter__N)r,r7r8rsrSrBr.r.r.r/�MySetzsr�)r)r7r�rrer�r�r)r-�sampler�r.r.r/�test_SetuszTestCollectionABCs.test_SetcCs8Gdd�dt�}|�|�}}|jt|�t|�k�dS)Nc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)z8TestCollectionABCs.test_hash_Set.<locals>.OneTwoThreeSetcSsdddg|_dS)Nr:r;r?)�contents)r-r.r.r/r�szATestCollectionABCs.test_hash_Set.<locals>.OneTwoThreeSet.__init__cSs
||jkS)N)r�)r-r|r.r.r/rs�szETestCollectionABCs.test_hash_Set.<locals>.OneTwoThreeSet.__contains__cSs
t|j�S)N)rHr�)r-r.r.r/rS�sz@TestCollectionABCs.test_hash_Set.<locals>.OneTwoThreeSet.__len__cSs
t|j�S)N)rDr�)r-r.r.r/rB�szATestCollectionABCs.test_hash_Set.<locals>.OneTwoThreeSet.__iter__cSs|j�S)N)�_hash)r-r.r.r/r��szATestCollectionABCs.test_hash_Set.<locals>.OneTwoThreeSet.__hash__N)r,r7r8rrsrSrBr�r.r.r.r/�OneTwoThreeSet�s
r�)rrer9)r-r�r'r(r.r.r/�
test_hash_Set�sz TestCollectionABCs.test_hash_SetcCsLGdd�dt�}|d	�}|d
�}|d�}|j|j|��|j|j|��dS)Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z5TestCollectionABCs.test_isdisjoint_Set.<locals>.MySetcSs
||_dS)N)r�)r-�itrr.r.r/r�sz>TestCollectionABCs.test_isdisjoint_Set.<locals>.MySet.__init__cSs
||jkS)N)r�)r-r|r.r.r/rs�szBTestCollectionABCs.test_isdisjoint_Set.<locals>.MySet.__contains__cSs
t|j�S)N)rDr�)r-r.r.r/rB�sz>TestCollectionABCs.test_isdisjoint_Set.<locals>.MySet.__iter__cSstdd�|jD��S)NcSsg|]}|�qSr.r.)r�r|r.r.r/r��szQTestCollectionABCs.test_isdisjoint_Set.<locals>.MySet.__len__.<locals>.<listcomp>)rHr�)r-r.r.r/rS�sz=TestCollectionABCs.test_isdisjoint_Set.<locals>.MySet.__len__N)r,r7r8rrsrBrSr.r.r.r/r��sr�r:r;r?r�rC�)r:r;r?)r�rCr�)r:rCr�)rre�
isdisjointrd)r-r��s1�s2�s3r.r.r/�test_isdisjoint_Set�s	z&TestCollectionABCs.test_isdisjoint_SetcCs�Gdd�dt�}|d�}|d�}|d	�}|d
�}|j||k�|j||k�|j||k�|j||k�|j||k�|j||�|j||�dS)Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z3TestCollectionABCs.test_equality_Set.<locals>.MySetcSs
||_dS)N)r�)r-r�r.r.r/r�sz<TestCollectionABCs.test_equality_Set.<locals>.MySet.__init__cSs
||jkS)N)r�)r-r|r.r.r/rs�sz@TestCollectionABCs.test_equality_Set.<locals>.MySet.__contains__cSs
t|j�S)N)rDr�)r-r.r.r/rB�sz<TestCollectionABCs.test_equality_Set.<locals>.MySet.__iter__cSstdd�|jD��S)NcSsg|]}|�qSr.r.)r�r|r.r.r/r��szOTestCollectionABCs.test_equality_Set.<locals>.MySet.__len__.<locals>.<listcomp>)rHr�)r-r.r.r/rS�sz;TestCollectionABCs.test_equality_Set.<locals>.MySet.__len__N)r,r7r8rrsrBrSr.r.r.r/r��sr�r:r;r?r�)r:)r:r;)r?r�)r?r�)rrerdrEZassertNotEqual)r-r�r�r�r�Zs4r.r.r/�test_equality_Set�s	z$TestCollectionABCs.test_equality_SetcCs<Gdd�dt�}|d�}|d	�}||@}|j||d
��dS)Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z5TestCollectionABCs.test_arithmetic_Set.<locals>.MySetcSs
||_dS)N)r�)r-r�r.r.r/r�sz>TestCollectionABCs.test_arithmetic_Set.<locals>.MySet.__init__cSs
||jkS)N)r�)r-r|r.r.r/rs�szBTestCollectionABCs.test_arithmetic_Set.<locals>.MySet.__contains__cSs
t|j�S)N)rDr�)r-r.r.r/rB�sz>TestCollectionABCs.test_arithmetic_Set.<locals>.MySet.__iter__cSstdd�|jD��S)NcSsg|]}|�qSr.r.)r�r|r.r.r/r��szQTestCollectionABCs.test_arithmetic_Set.<locals>.MySet.__len__.<locals>.<listcomp>)rHr�)r-r.r.r/rS�sz=TestCollectionABCs.test_arithmetic_Set.<locals>.MySet.__len__N)r,r7r8rrsrBrSr.r.r.r/r��sr�r:r;r?r�rC)r:r;r?)r?r�rC)r?)rrE)r-r�r�r�r�r.r.r/�test_arithmetic_Set�s
	z&TestCollectionABCs.test_arithmetic_SetcCsT|jt�t�|jttt��|jt�t�|jttt��|jtddddd�dS)NrsrBrSr�r�)	r�r)rrer�r�r7rdr�)r-r.r.r/�test_MutableSet�sz"TestCollectionABCs.test_MutableSetcCs,td�}|td�M}|jt|�td��dS)N�abcdZcdefZcd)r�rEr))r-r�r.r.r/�test_issue_5647�sz"TestCollectionABCs.test_issue_5647cCs4Gdd�dt�}|ddddg�}|j|j�d�dS)Nc@sLeZdZdgZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)z1TestCollectionABCs.test_issue_4920.<locals>.MySetZ__sNcSs|dkrg}t|�|_dS)N)r)�	_MySet__s)r-rGr.r.r/r�sz:TestCollectionABCs.test_issue_4920.<locals>.MySet.__init__cSs
||jkS)N)r�)r-r\r.r.r/rs�sz>TestCollectionABCs.test_issue_4920.<locals>.MySet.__contains__cSs
t|j�S)N)rDr�)r-r.r.r/rB�sz:TestCollectionABCs.test_issue_4920.<locals>.MySet.__iter__cSs
t|j�S)N)rHr�)r-r.r.r/rS�sz9TestCollectionABCs.test_issue_4920.<locals>.MySet.__len__cSs||jk}|jj|�|S)N)r�r�)r-r\rvr.r.r/r��s
z5TestCollectionABCs.test_issue_4920.<locals>.MySet.addcSs||jk}|jj|�|S)N)r�r�)r-r\rvr.r.r/r��s
z9TestCollectionABCs.test_issue_4920.<locals>.MySet.discardcSsdtt|��S)Nz	MySet(%s))rKr3)r-r.r.r/�__repr__�sz:TestCollectionABCs.test_issue_4920.<locals>.MySet.__repr__)N)r,r7r8r�rrsrBrSr�r�r�r.r.r.r/r��s
r�rC�+r;r:)rrErj)r-r�r�r.r.r/�test_issue_4920�sz"TestCollectionABCs.test_issue_4920cCs~t�}ttd��}t|�}||8}|j||�t|�}||N}|j||�t|�}||M}|j||�||O}|j||�dS)Nr�)r�rQrE)r-�emptyZfullr�r.r.r/�test_issue8750�sz!TestCollectionABCs.test_issue8750cCshGdd�dt�}Gdd�dt�}|�}|�}|j||k�|j||k�|j||k�|j||k�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z;TestCollectionABCs.test_issue16373.<locals>.MyComparableSetcSsdS)NFr.)r-r|r.r.r/rsszHTestCollectionABCs.test_issue16373.<locals>.MyComparableSet.__contains__cSsdS)Nrr.)r-r.r.r/rSszCTestCollectionABCs.test_issue16373.<locals>.MyComparableSet.__len__cSstg�S)N)rD)r-r.r.r/rBszDTestCollectionABCs.test_issue16373.<locals>.MyComparableSet.__iter__N)r,r7r8rsrSrBr.r.r.r/�MyComparableSetsr�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)z>TestCollectionABCs.test_issue16373.<locals>.MyNonComparableSetcSsdS)NFr.)r-r|r.r.r/rs
szKTestCollectionABCs.test_issue16373.<locals>.MyNonComparableSet.__contains__cSsdS)Nrr.)r-r.r.r/rSszFTestCollectionABCs.test_issue16373.<locals>.MyNonComparableSet.__len__cSstg�S)N)rD)r-r.r.r/rBszGTestCollectionABCs.test_issue16373.<locals>.MyNonComparableSet.__iter__cSstS)N)�NotImplemented)r-r|r.r.r/rszETestCollectionABCs.test_issue16373.<locals>.MyNonComparableSet.__le__cSstS)N)r�)r-r|r.r.r/r	szETestCollectionABCs.test_issue16373.<locals>.MyNonComparableSet.__lt__N)r,r7r8rsrSrBrr	r.r.r.r/�MyNonComparableSet	s
r�)rrdre)r-r�r�ZcsZncsr.r.r/�test_issue16373�sz"TestCollectionABCs.test_issue16373c	Cs�Gdd�d�}Gdd�dt�}td�}|�}||||g�}|t||d��t||d��g}x&|D]}x|D]}|j||�qhWq^W|j|j|�d�|j|j|�d�|j|j|�d	�|j|j|�d�dS)
Nc@seZdZdd�ZdS)z=TestCollectionABCs.test_issue26915.<locals>.CustomEqualObjectcSsdS)NFr.)r-rr.r.r/rszDTestCollectionABCs.test_issue26915.<locals>.CustomEqualObject.__eq__N)r,r7r8rr.r.r.r/�CustomEqualObjectsr�c@s$eZdZdd�Zdd�Zdd�ZdS)z:TestCollectionABCs.test_issue26915.<locals>.CustomSequencecSs
||_dS)N)�_seq)r-�seqr.r.r/r"szCTestCollectionABCs.test_issue26915.<locals>.CustomSequence.__init__cSs
|j|S)N)r�)r-�indexr.r.r/rr$szFTestCollectionABCs.test_issue26915.<locals>.CustomSequence.__getitem__cSs
t|j�S)N)rHr�)r-r.r.r/rS&szBTestCollectionABCs.test_issue26915.<locals>.CustomSequence.__len__N)r,r7r8rrrrSr.r.r.r/�CustomSequence!sr��nan)r:r;rr:r;)r#r5r!r"rIrEr��count)	r-r�r�r��objr�Z
containersZ	container�elemr.r.r/�test_issue26915s

z"TestCollectionABCs.test_issue26915cCs|jt|�t|��dS)N)ZassertSetEqualr))r-r�r�r.r.r/�
assertSameSet9sz TestCollectionABCs.assertSameSetcWCs Gdd�dt�}td�}td�}td�}|d�}|d�}|d�}td�}td�}	td�}
||@}|j||@|�|j||@|�|j||@|�|j||	@|�||B}|j||B|�|j||B|�|j||B|�|j||	B|�||}||}
|j|||�|j|||
�|j|||�|j|||
�|j|||�|j|||
�|j||	|�|j|||
�||A}|j||A|�|j||A|�|j||A|�|j||	A|�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|jt��||
kWdQRX|jt��||kWdQRX|jt��||	kWdQRX|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|jt��||
kWdQRX|jt��||kWdQRX|jt��||	kWdQRX|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|jt��||
kWdQRX|jt��||kWdQRX|jt��||	kWdQRX|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|jt��||
kWdQRX|jt��||kWdQRX|jt��||	kWdQRX|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||
k�|j||k�|j||	k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�|j||
k�|j||k�|j||	k�dS)	Nc@s8eZdZffdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)zLTestCollectionABCs.test_Set_interoperability_with_real_sets.<locals>.ListSetcSs.g|_x"|D]}||jkr|jj|�qWdS)N)r�r|)r-�elementsr�r.r.r/r@s

zUTestCollectionABCs.test_Set_interoperability_with_real_sets.<locals>.ListSet.__init__cSs
||jkS)N)r�)r-r�r.r.r/rsEszYTestCollectionABCs.test_Set_interoperability_with_real_sets.<locals>.ListSet.__contains__cSs
t|j�S)N)rDr�)r-r.r.r/rBGszUTestCollectionABCs.test_Set_interoperability_with_real_sets.<locals>.ListSet.__iter__cSs
t|j�S)N)rHr�)r-r.r.r/rSIszTTestCollectionABCs.test_Set_interoperability_with_real_sets.<locals>.ListSet.__len__cSsdj|j�S)Nz	Set({!r}))r+r�)r-r.r.r/r�KszUTestCollectionABCs.test_Set_interoperability_with_real_sets.<locals>.ListSet.__repr__N)r,r7r8rrsrBrSr�r.r.r.r/�ListSet?s
r�r@ZbcdZabcdeZabccbaZbcddcbZ
abcdeedcba)rr)r3r�rerdrlr�)r-r�Zr1Zr2Zr3�f1�f2Zf3�l1�l2�l3�targetZ
fwd_targetZ
rev_targetr.r.r/�(test_Set_interoperability_with_real_sets=s�	z;TestCollectionABCs.test_Set_interoperability_with_real_setscCspx,tgD]"}|j|�t�|jt|t��qW|jtdddd�Gdd�dt�}|j|��|jtt	|��dS)NrsrBrSrrc@s$eZdZdd�Zdd�Zdd�ZdS)z2TestCollectionABCs.test_Mapping.<locals>.MyMappingcSsdS)Nrr.)r-r.r.r/rS�sz:TestCollectionABCs.test_Mapping.<locals>.MyMapping.__len__cSst�dS)N)r�)r-r�r.r.r/rr�sz>TestCollectionABCs.test_Mapping.<locals>.MyMapping.__getitem__cSstf�S)N)rD)r-r.r.r/rB�sz;TestCollectionABCs.test_Mapping.<locals>.MyMapping.__iter__N)r,r7r8rSrrrBr.r.r.r/�	MyMapping�sr�)
r5r�rrer�r�rrlr�rK)r-r�r�r.r.r/�test_Mapping�szTestCollectionABCs.test_MappingcCsHx,tgD]"}|j|�t�|jt|t��qW|jtdddddd�dS)NrsrBrSrr�__setitem__�__delitem__)r5r�rrer�r�)r-r�r.r.r/�test_MutableMapping�s
z&TestCollectionABCs.test_MutableMappingcCs�t�}d|d<|j|j�t�|j|j�t�|j|j�t�|j|j�t�t�}d|d<|j�dhB}|j|t�t|�d|d<|j	t
|�ddg�t�}d|d<|j�dhB}|j|t�t|�d|d<|j	t
|�dd	g�dS)
NrCr��orange�r�r?)r�r?)r�r?)r�rC)r	r�rGrr rGr!r)r3rE�sorted)r-ZmymaprBr.r.r/�test_MutableMapping_subclass�s(z/TestCollectionABCs.test_MutableMapping_subclasscCs�x2ttttgD]"}|j|�t�|jt|t��qW|jtd�t�|jttt��|jt	d�t�|jtt	t��|jttt��|j
tdddd�dS)Nr�rRrsrBrSrr)r�r3r8r1r�r#rer�rQ�
memoryviewr�)r-r�r.r.r/�
test_Sequencesz TestCollectionABCs.test_Sequencec

s�Gdd�dt�}�fdd�}x�ttfD]�}|d�}d
dgttdt|�d��}||�}x~t|�d	hBD]l}||||f�xXtd
t|�d�D]B}|||||f�x,tdt|�d�D]}	||||||	f�q�Wq�WqhWq&WdS)Nc@s(eZdZffdd�Zdd�Zdd�ZdS)zATestCollectionABCs.test_Sequence_mixins.<locals>.SequenceSubclasscSs
||_dS)N)r�)r-r�r.r.r/rszJTestCollectionABCs.test_Sequence_mixins.<locals>.SequenceSubclass.__init__cSs
|j|S)N)r�)r-r�r.r.r/rrszMTestCollectionABCs.test_Sequence_mixins.<locals>.SequenceSubclass.__getitem__cSs
t|j�S)N)rHr�)r-r.r.r/rSszITestCollectionABCs.test_Sequence_mixins.<locals>.SequenceSubclass.__len__N)r,r7r8rrrrSr.r.r.r/�SequenceSubclasssr�cshy|j|�}Wn4tk
rB�jt��|j|�WdQRXYn"X|j|�}�j||d||f�dS)Nz
%r.index%s)r�r�rlrE)Zseq1Zseq2Z
index_argsZexpectedZactual)r-r.r/�assert_index_sames
zBTestCollectionABCs.test_Sequence_mixins.<locals>.assert_index_same�abracadabrai'i'r?rBi���i������r�r�)r#r3r1rQrHr))
r-r�r�ZtyZ	nativeseqZindexesZseqseqZletter�start�stopr.)r-r/�test_Sequence_mixinssz'TestCollectionABCs.test_Sequence_mixinscCs�x.ttgD]"}|j|�t�|jt|t��q
Wx0tttgD]"}|j	|�t�|j
t|t��q<W|j	td�t�|j
ttt��dS)NrR)r8r4r�r%rer�r1r3r�r�rdr�)r-r�r.r.r/�test_ByteString4sz"TestCollectionABCs.test_ByteStringc	Cs�x0tttgD]"}|j|�t�|jt|t��qWx0ttt	gD]"}|j
|�t�|jt|t��q>W|jttt��|jtddddddd�dS)NrsrBrSrrr�r��insert)
r�r1r8r�r$rdr�r3r4r
r�rer�)r-r�r.r.r/�test_MutableSequence>s
z'TestCollectionABCs.test_MutableSequencecCs�Gdd�dt�}|�}|jd�|jd
�|jt|�d�|j|dd�|j�|j|dd�|j�|jt|�d�|jd�|jt|�d�|d7}|jt|�d�|j|dd�|j�|jt|�d�dS)Nc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)zOTestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclasscSs
g|_dS)N)�lst)r-r.r.r/rMszXTestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclass.__init__cSs||j|<dS)N)r�)r-r�rr.r.r/r�Psz[TestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclass.__setitem__cSs
|j|S)N)r�)r-r�r.r.r/rrSsz[TestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclass.__getitem__cSs
t|j�S)N)rHr�)r-r.r.r/rSVszWTestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclass.__len__cSs|j|=dS)N)r�)r-r�r.r.r/r�Ysz[TestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclass.__delitem__cSs|jj||�dS)N)r�r�)r-r�rr.r.r/r�\szVTestCollectionABCs.test_MutableSequence_mixins.<locals>.MutableSequenceSubclass.insertN)	r,r7r8rr�rrrSr�r�r.r.r.r/�MutableSequenceSubclassLsr�rr:r;r?r�rCr�r<r=r�)r:r;r?r�)r�r<r=r�)	r$r|�extendrErH�reverserj�remove�clear)r-r�Zmssr.r.r/�test_MutableSequence_mixinsIs"


z.TestCollectionABCs.test_MutableSequence_mixinsN)r,r7r8r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r.r.r.r/r�os,#
r�c@seZdZdd�Zdd�ZdS)�CounterSubclassWithSetItemcOsd|_tj|f|�|�dS)NF)�calledrr)r-r��kwdsr.r.r/rvsz#CounterSubclassWithSetItem.__init__cCsd|_tj|||�dS)NT)r�rr�)r-rZrr.r.r/r�ysz&CounterSubclassWithSetItem.__setitem__N)r,r7r8rr�r.r.r.r/r�tsr�c@seZdZdd�Zdd�ZdS)�CounterSubclassWithGetcOsd|_tj|f|�|�dS)NF)r�rr)r-r�r�r.r.r/rszCounterSubclassWithGet.__init__cCsd|_tj|||�S)NT)r�rrJ)r-rZ�defaultr.r.r/rJ�szCounterSubclassWithGet.getN)r,r7r8rrJr.r.r.r/r�}sr�c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�TestCounterc	Cs�td�}|j|tdddd���|j|tdddd��|j|t�|j|t�|jttt��|jttt��|jt|�d�|jt|j	��d�|jt
|j	��dddg�|jt
|j��ddd	g�|jt
|�ddd	g�|jt
|j��d%d&d'g�|j|dd�|j|d
d�|j|j
d	�d�|j|j
d
�d
�|j|jdd�d�|j|jd
d�d�|j|tdddd��|jt|�d�|j|j�d(d)d*g�x2td�D]&}|j|j|�d+d,d-gd|���q�W|jdjt
|j���d�|dd7<|dd8<|d	=|d	=|dd8<d.|d<|dd7<|j|tddd/d0dd��|jdjt
|j���d�|j|jd�d�|jd|�x*td�D]}|j�\}}|j||��q�W|j�|j|i�|jt|�d�|jttjd�|jtt|�|jtddd��|jdd�|jtdddd��|j�|jdddd �|jd!�|j�|j|td"d#ddd$��|j|jdd�d�|j|dd�|j|jdd�d�|j|dd�dS)1NZabcabar?r;r:)r'r(r>r�r'r(r>rBrTFr�z!Counter({'a': 3, 'b': 2, 'c': 1})rCr�ZaaabbcrYr]rar�)r'r(rYr]raZaaaaffffz	Counter()r@)r'r()r>r�r=i�i,Zcdci+iM)r'r(r>rY)r'r?)r(r;)r>r:)r'r?)r(r;)r>r:)r'r?)r(r;)r>r:r����r�) rrEr�r5rrer�rH�sumr�r�rGrGrsrJrK�most_commonrQr�r�rjr�rkr�rl�NotImplementedErrorr�r�r9�updater�
setdefault)r-r>r�r�Zcntr.r.r/rb�st
zTestCounter.test_basicscCs�|jttdd�j��dg�|jttdd�j��dg�|jttdd�j��dg�|jttd�|jttff�|jttj�dS)	Nr�)r-r-)�iterabler�)r-r�)r�r�)r�N)rEr3rrGrlr�r)r-r.r.r/�	test_init�szTestCounter.test_initcCs�t�}|jdd�|jt|j��dg�t�}|jdd�|jt|j��dg�t�}|jdd�|jt|j��dg�|jtt�jd�|jtt�jii�|jttj�dS)	Nr�)r-r-)r�r�)r-r�)r�r�)r�N)rr�rEr3rGrlr�)r-r>r.r.r/�test_update�szTestCounter.test_updatec
s�tdj�����fdd�}|�j��|tj���|tj���xDttjd�D]2}�j|d��|tjtj	�|���WdQRXqRW|t
t����t�}|j��||�|t���dS)Nz)which witch had which witches wrist watchcs*d|�f}�j|�|��j|��dS)Nz
copy: %s
words: %s)rNrE)�dup�msg)r-r�r.r/�check�sz'TestCounter.test_copying.<locals>.checkr:)r`)
r�splitrMrVrQrRrSZsubTestrTrUrWrKr�)r-r�r`Zupdate_testr.)r-r�r/�test_copying�s$
zTestCounter.test_copyingcCsXGdd�dt�}|d�}|j�}|j||�|jt|�t|��|jt|�t|��dS)Nc@seZdZdS)z1TestCounter.test_copy_subclass.<locals>.MyCounterN)r,r7r8r.r.r.r/�	MyCounter�sr�Zslartibartfast)rrMrErHrL)r-r�r>rYr.r.r/�test_copy_subclass�szTestCounter.test_copy_subclasscCsxd}|jtt|�j��t|��|jtt|��tt|���|jtt|��tt|�j���|jtt|��t|��dS)Nz%she sells sea shells by the sea shore)rEr�rr�r)r5rG)r-r�r.r.r/�test_conversions�s
 zTestCounter.test_conversionscCs:tdddd�}x&|D]}|j||k�|j||�qWdS)Nr�r;r)r'r(r>r�)rrerI)r-r>r�r.r.r/�"test_invariant_for_the_in_operator�s
z.TestCounter.test_invariant_for_the_in_operatorc

Cs�tdddd�t�}|jt|�tdd��d}x�td�D]�}ttdd	�|D���}|jd
ddd�ttdd	�|D���}|jd
ddd
�x�tjdd�ftjdd�ftjdd�ftjdd�fgD]`\}}|||�}x4|D],}	|j|||	||	�||	||	||f�q�W|j	dd	�|j
�D��q�Wq8Wd}x�td�D]�}ttdd	�|D���}ttdd	�|D���}xhtjtjftjtjftjtjfgD]B\}}
|||�}|
t|j��t|j���}|j|tj
|d
���q�W�q4WdS)Nr�r;r)r'r(r>)r'r�i�css|]}|tdd�fVqdS)r;r�Nr�)r)r�r�r.r.r/r�
sz7TestCounter.test_multiset_operations.<locals>.<genexpr>r:)r]ra�gcss|]}|tdd�fVqdS)r;r�Nr�)r)r�r�r.r.r/r�s)�hr�r�cSstd||�S)Nr)r�)r|r}r.r.r/r�sz6TestCounter.test_multiset_operations.<locals>.<lambda>cSstd||�S)Nr)r�)r|r}r.r.r/r�scSstd||�S)Nr)r�)r|r}r.r.r/r�scSstdt||��S)Nr)r��min)r|r}r.r.r/r�scss|]}|dkVqdS)rNr.)r�r|r.r.r/r�sZabcdefrAcss|]}|tdd�fVqdS)rr;N)r)r�r�r.r.r/r�!scss|]}|tdd�fVqdS)rr;N)r)r�r�r.r.r/r�"sr�r�r�)rrEr5rQr��__add__�__sub__�__or__�__and__rer�r)r�r�)
r-r>r�r�r�r�Z	counteropZnumberoprvr|ZsetopZcounter_resultZ
set_resultr.r.r/�test_multiset_operationss:

 


z$TestCounter.test_multiset_operationscCs�d}x�td�D]�}ttdd�|D���}|jdd
dd�ttdd�|D���}|jdddd	�xxtjtjftjtjftjtj	ftj
tjfgD]H\}}|j�}t
|�}|||�}	|||�}
|j|
|	�|jt
|
�|�q�WqWdS)Nr�i�css|]}|tdd�fVqdS)r;r�Nr�)r)r�r�r.r.r/r�0sz6TestCounter.test_inplace_operations.<locals>.<genexpr>r:r)r]rar�css|]}|tdd�fVqdS)r;r�Nr�)r)r�r�r.r.r/r�2s)r�r�r�r�r�)rQrr5r��__iadd__r��__isub__r��__ior__r��__iand__r�rM�idrE)r-r�r�r�r�Z
inplace_opZ
regular_opr>Zc_idZregular_resultZinplace_resultr.r.r/�test_inplace_operations,s"




z#TestCounter.test_inplace_operationscCsPtddddddd�}|jddddd
ddd
�|j|tddddddddd��td dddddd�}|jtddd!dd
dd"d
��|j|td#d$ddd%d&ddd��td�}|jd�|j|td'dd(dd)d��t�}|jdd�|jt|j��d+g�t�}|jdd�|jt|j��d-g�|jtt�jd�|jtt�jii�|jttj�dS).NrCrr��r�)r'r(r>rYr]r�r:r;r?r<r=r�)r'r(r>rYr]rar�r��)r'r(r>rYr]rar�r�ZaaabbcdZ	aaaabbcce)r'r(r>rYr]r�)r-r-)r�r�r�r�i���i����r�r�i��r�r�i���i����r�r�i��r�r�r�����)r-r�����)r�r�)r�subtractrEr3rGrlr�)r-r>r.r.r/�
test_subtractAs$  
zTestCounter.test_subtractcCsNtd	dddddd�}|jt|
�tddddd��|jt|�tdd��dS)
NrCrr�r�r�)r'r(r>rYr]r�)r>rYr]r�)r'r�)rrEr5)r-r>r.r.r/�
test_unaryVszTestCounter.test_unarycCs0tddd�}t|�}|jd|�|jd|�dS)Nr;)r'r(z'a': 2z	'b': None)rrKrI)r-r>�rr.r.r/�test_repr_nonsortable[sz!TestCounter.test_repr_nonsortablec	Cs�td�}t�}t||�|j|dddddd��t�}t||�|j|tdd
dddg��td�}|j|j�|jt|�dddddd��td�}|j|j�|jt|�dddddd��dS)Nr�rCr;r:)r'rr(r>rYr'r(rr>rY)r'r(r>rYr)r'rC)r(r;)rr;)r>r:)rYr:)	r3r5rrErr�rer�r�)r-ZelemsrYrwr>r.r.r/�test_helper_functionas

z TestCounter.test_helper_functionN)r,r7r8rbr�r�r�r�r�r�r�r�r�r�rrr.r.r.r/r��s<	'r�cCs8tjtd�}t|tttttg}t	j
|�t	jt|�dS)N)r�)�doctestZDocTestSuiter�rzrr�r�r9r&rZrun_unittestZrun_doctest)r�ZNamedTupleDocsZtest_classesr.r.r/�	test_main{s
r�__main__T)r�)N)Cr�r�rMr�inspectr�rrRZrandomrrr�r�r�Ztestrr*r�rrrrr	r
rrr
�collections.abcrrrrrrrrrrrrrrrrrrr r!r"r#r$r%ZTestCaser&r9ryrzr�rrr�r�r�r�r�rr,r.r.r.r/�<module>sj
;a			v




Youez - 2016 - github.com/yon3zu
LinuXploit