Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.15.141.23
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_pprint.cpython-310.pyc
o

ab9��@sddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
Gdd�de�ZGdd�de�Z
Gdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZejGd d!�d!��Z ejGd"d#�d#��Z!ejd$d%�Gd&d'�d'��Z"ejGd(d)�d)��Z#ejGd*d+�d+��Z$ejGd,d-�d-��Z%Gd.d/�d/�Z&Gd0d1�d1�Z'Gd2d3�d3e
j(�Z)Gd4d5�d5ej*�Z+e,d6k�r
e
�-�dSdS)7�Nc@�eZdZdS)�list2N��__name__�
__module__�__qualname__�rr�9/usr/local/python-3.10/lib/python3.10/test/test_pprint.pyr�rc@�eZdZdd�ZdS)�list3cC�
t�|�S�N)�list�__repr__��selfrrr	r�
zlist3.__repr__N�rrrrrrrr	r�rc@r)�list_custom_reprcC�dtt�|��S�N�*)�lenrrrrrr	r�zlist_custom_repr.__repr__Nrrrrr	rrrc@r)�tuple2Nrrrrr	rr
rc@r)�tuple3cCr
r)�tuplerrrrr	rrztuple3.__repr__Nrrrrr	rrrc@r)�tuple_custom_reprcCrr)rrrrrrr	r"rztuple_custom_repr.__repr__Nrrrrr	r!rrc@r)�set2Nrrrrr	r %r
r c@r)�set3cCr
r)�setrrrrr	r)rz
set3.__repr__Nrrrrr	r!(rr!c@r)�set_custom_reprcCrr)rr"rrrrr	r-rzset_custom_repr.__repr__Nrrrrr	r#,rr#c@r)�
frozenset2Nrrrrr	r$0r
r$c@r)�
frozenset3cCr
r)�	frozensetrrrrr	r4rzfrozenset3.__repr__Nrrrrr	r%3rr%c@r)�frozenset_custom_reprcCrr)rr&rrrrr	r8rzfrozenset_custom_repr.__repr__Nrrrrr	r'7rr'c@r)�dict2Nrrrrr	r(;r
r(c@r)�dict3cCr
r)�dictrrrrr	r?rzdict3.__repr__Nrrrrr	r)>rr)c@r)�dict_custom_reprcCrr)rr*rrrrr	rCrzdict_custom_repr.__repr__Nrrrrr	r+Brr+c@s@eZdZUeed<eed<dZeed<ej	ddd�Z
eed<dS)	�
dataclass1Zfield1Zfield2F�field3�)�default�repr�field4N)rrr�str�__annotations__�intr-�bool�dataclassesZfieldr1rrrr	r,Fs

r,c@s"eZdZUdZeed<dd�ZdS)�
dataclass2r.�acC�dS)N�0custom repr that doesn't fit within pprint widthrrrrr	rP�zdataclass2.__repr__N)rrrr8r4r3rrrrr	r7Ms
r7F)r0c@seZdZUdZeed<dS)�
dataclass3r.r8N)rrrr8r4r3rrrr	r<Ss
r<c@s"eZdZUded<dZeed<dS)�
dataclass4r8r.�bN�rrrr3r>r4rrrr	r=W�
r=c@�"eZdZUded<dZeed<dS)�
dataclass5�
dataclass6r8r.r>Nr?rrrr	rB\r@rBc@rA)rCrB�cr.�dN)rrrr3rEr4rrrr	rCar@rCc@r)�UnorderablecCstt|��Sr)r2�idrrrr	rgszUnorderable.__repr__Nrrrrr	rFfrrFc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�	OrderablecCs
||_dSr��_hash)r�hashrrr	�__init__lrzOrderable.__init__cCr9)NFr�r�otherrrr	�__lt__nr;zOrderable.__lt__cCs||kSrrrMrrr	�__gt__p�zOrderable.__gt__cCs||kSrrrMrrr	�__le__rrQzOrderable.__le__cCr9)NTrrMrrr	�__ge__tr;zOrderable.__ge__cCs||uSrrrMrrr	�__eq__vrQzOrderable.__eq__cCs||uSrrrMrrr	�__ne__xrQzOrderable.__ne__cCs|jSrrIrrrr	�__hash__zszOrderable.__hash__N)rrrrLrOrPrRrSrTrUrVrrrr	rHksrHc@szeZdZdd�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+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zej e!j"j#d9d:���Z$d;d<�Z%d=d>�Z&d?d@�Z'dAdB�Z(dCdD�Z)dEdF�Z*dGdH�Z+dIdJ�Z,dKdL�Z-dMdN�Z.dOdP�Z/dQdR�Z0dSdT�Z1dUdV�Z2dWdX�Z3dYS)Z�
QueryTestCasecCs,ttd��|_ttd��|_|j|jd<dS)N�d��i�)r�ranger8r>rrrr	�setUpszQueryTestCase.setUpcCs�t��}tjdddt��dd�}t�dddt���}tjdd�}|�t��t�dddt��d�}Wd�n1s;wY|jttjdd	�|jttjd
d�|jttjdd�|jttjd
d�dS)
N��(�T)�indent�width�depth�stream�compactF�Z
sort_dicts����r_r�ra�r`)�pprint�
PrettyPrinter�io�StringIOZassertRaises�	TypeError�
ValueError)r�pprrr	�	test_init�s
��zQueryTestCase.test_initcCs�t��}dddddgdddidtd�d	d
dd|j|jfD]2}|�t�|�d|f�|�t�|�d
|f�|�|�|�d|f�|�|�|�d
|f�qdS)N�g@y@�abc�)rqrqsdefsghiTF.�expected not isrecursive for %r�expected isreadable for %r)	rirj�	bytearrayr8r>�assertFalse�isrecursive�
assertTrue�
isreadable)rro�saferrr	�
test_basic�s$������zQueryTestCase.test_basiccCsH|j|jd<i|_|j|jd<|jd<|jd<t��}|j|j|j|j|jffD]&}|�t�|�d�|�t�|�d�|�|�|�d�|�|�|�d�q*|j�	�|jdd�=|jdd�=|j|j|j|j|jffD]2}|�t�|�d|f�|�t�|�d|f�|�|�|�d|f�|�|�|�d|f�qodS)	N�Crr.rqzexpected isrecursivezexpected not isreadablertru)
r8r>rErirjryrxrwrz�clear)rroZickyr{rrr	�test_knotted�s4 
�����zQueryTestCase.test_knottedcCs�t��}td�ttjfD]2}|�t�|�d|f�|�t�|�d|f�|�|�|�d|f�|�|�|�d|f�qdS)Nrsrtzexpected not isreadable for %r)rirj�typerxrwrz)rroZ
unreadablerrr	�test_unreadable�s�����zQueryTestCase.test_unreadablecCs�gd�d�d�d�d�d�t��d�t��t��g�t��t��t��t��t��t��t	��t
��i�t��t��|j
�t�d�d�d�d	�d
�d�td��d�d
g�d
di�d�d
dg�ddi�td��td��ttd���d
dg�td
dg��td
dg��ttd���tdh��tdh��tdh��tdh��t	dh��t
dh��tddi��tddi��tddd��d�d�d�d�RD]3}t|�}|�t�|�|�|�tj|ddd��dd�|�|�tj|dd�|�|�t�|�|�q�dS) Nryg��ri����y��g���x�x�rsrs�)r.rqr\r^rX���
i����reTF.r.�r`r_�
� �Zunderscore_numbers)rvrrrrr"r r!r&r$r%r(r)ryrirZr0�assertEqual�pformat�replace�saferepr)r�simple�nativerrr	�test_same_as_repr�s� 
���������������������������	�	�	�
�
�

��
�
�
����
�
�
�
�
�
����
�
��zQueryTestCase.test_same_as_reprcCs�d}t�tgd��tt|��t�tgd��tt|��t�tgd��tt|��t�tgd��tt|��t�tddi�ttt|�t|���fD]*}t|�}dt|�}|�	t
�|�|�|�	t
j|ddd�|�|�	t
�|�|�qEdS)	N��)r.rqrsr^r�rr.rr�)
rrZrr#r'r+�zipr0rr�rir�r�)r�NZcontr��expectedrrr	�#test_container_repr_override_called�s.








��z1QueryTestCase.test_container_repr_override_calledcCsdddddddd�}d}ttfD]
}|�t�||��|�qtd�}dd�tt|��}t	t
fD]
}|�t�||��|�q0ttd��}d	d�tt|��}ttfD]
}|�t�||��|�qRtd�}d
d�tt|��}t	t
fD]}|�tj||�dd
�|�qrdS)Nri��i��)ZRPM_calZRPM_cal2Z	Speed_calZcontroldesk_runtime_usZmain_code_runtime_usZread_io_runtime_usZwrite_io_runtime_usz�{'RPM_cal': 0,
 'RPM_cal2': 48059,
 'Speed_cal': 0,
 'controldesk_runtime_us': 0,
 'main_code_runtime_us': 0,
 'read_io_runtime_us': 0,
 'write_io_runtime_us': 43690}rXz[%s]z,
 z(%s)z[   %s]z,
    r\rf)
r*r(r�rir�rZ�join�mapr2rrrr)r�o�expr�rrr	�test_basic_line_wraps0��z"QueryTestCase.test_basic_line_wrapcCs^ttd��}tdddd�}||g}d}|�tj|ddd	�|�d
}|�tj|ddd	�|�dS)Nr�r.rqrs)�first�second�thirdzN[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    {'first': 1, 'second': 2, 'third': 3}]r\�*)r_r`za[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    {   'first': 1,
        'second': 2,
        'third': 3}]�))rrZr*r�rir�)r�o1�o2r�r�rrr	�test_nested_indentations3sz&QueryTestCase.test_nested_indentationscCshd}t|�}|�tj|dd�|�|�tj|dd�|�|�tj|dd�|�|�tj|dd�d�dS)Nz�[[[[[[1, 2, 3],
     '1 2']]]],
 {1: [1, 2, 3],
  2: [12, 34]},
 'abc def ghi',
 ('ab cd ef',),
 set2({1, 23}),
 [[[[[1, 2, 3],
     '1 2']]]]]�rh���z�[[[[[[1,
      2,
      3],
     '1 '
     '2']]]],
 {1: [1,
      2,
      3],
  2: [12,
      34]},
 'abc def '
 'ghi',
 ('ab cd '
  'ef',),
 set2({1,
       23}),
 [[[[[1,
      2,
      3],
     '1 '
     '2']]]]])�evalr�rir�)rr�r�rrr	�
test_widthBs
zQueryTestCase.test_widthcsV|�t�d�d�|�tjddd�d�G�fdd�dt��|�t��d��d	�dS)
Ni��Z1234567Tr�Z	1_234_567cs&eZdZ��fdd�Zdd�Z�ZS)z/QueryTestCase.test_integer.<locals>.Temperaturecst���|�Sr)�super�__new__)�clsZcelsius_degrees)�Temperature�	__class__rr	r�msz7QueryTestCase.test_integer.<locals>.Temperature.__new__cSs|d}|�d�S)Ngfffffq@u°Kr)rZkelvin_degreesrrr	ros
z8QueryTestCase.test_integer.<locals>.Temperature.__repr__)rrrr�r�
__classcell__r�r�)r�r	r�lsr�r�u
1273.15°K)r�rir�r4rrr�r	�test_integerhszQueryTestCase.test_integercCsTdddd�}|�t�|�d�|�t�||g�d�|�t�dggid��d�dS)Nr.�r8r>rDz{'a': 1, 'b': 1, 'c': 1}z4[{'a': 1, 'b': 1, 'c': 1}, {'a': 1, 'b': 1, 'c': 1}]r�)zxy	ab
r^rz#{5: [[]], 'xy\tab\n': (3,), (): {}})r�rir��rrErrr	�test_sorted_dictts��zQueryTestCase.test_sorted_dictcCs>t�d�}|�tj|dd�d�|�tj||gdd�d�dS)NZcbaFrdz!{'c': None, 'b': None, 'a': None}zF[{'c': None, 'b': None, 'a': None}, {'c': None, 'b': None, 'a': None}])r*�fromkeysr�rir�r�rrr	�test_sort_dict�s

�zQueryTestCase.test_sort_dictcCspt��}|�tj|dd�d�t�g�}|�tj|dd�d�d��}t�t|t����}|�t�|�d�dS)Nr.rhz
OrderedDict()�*the quick brown fox jumped over a lazy dogz�OrderedDict([('the', 0),
             ('quick', 1),
             ('brown', 2),
             ('fox', 3),
             ('jumped', 4),
             ('over', 5),
             ('a', 6),
             ('lazy', 7),
             ('dog', 8)]))	�collections�OrderedDictr�rir��splitr��	itertools�count�rrE�wordsrrr	�test_ordered_dict�s
�zQueryTestCase.test_ordered_dictcCsjd��}tt|t����}t�|�}|�t�	|�d�t
�t|t����}t�|�}|�t�	|�d�dS)Nr�z�mappingproxy({'a': 6,
              'brown': 2,
              'dog': 8,
              'fox': 3,
              'jumped': 4,
              'lazy': 7,
              'over': 5,
              'quick': 1,
              'the': 0})a^mappingproxy(OrderedDict([('the', 0),
                          ('quick', 1),
                          ('brown', 2),
                          ('fox', 3),
                          ('jumped', 4),
                          ('over', 5),
                          ('a', 6),
                          ('lazy', 7),
                          ('dog', 8)])))r�r*r�r�r��types�MappingProxyTyper�rir�r�r�)rr�rE�mrrr	�test_mapping_proxy�s


z QueryTestCase.test_mapping_proxycCs"t��}t�|�}|�|d�dS)Nznamespace()�r��SimpleNamespacerir�r��r�ns�	formattedrrr	�test_empty_simple_namespace�s
z)QueryTestCase.test_empty_simple_namespacecCs(tjddd�}t�|�}|�|d�dS)Nr.rq)r8r>znamespace(a=1, b=2)r�r�rrr	�test_small_simple_namespace��
z)QueryTestCase.test_small_simple_namespacecCs<tjddddddddd	d
�	}tj|ddd�}|�|d
�dS)Nrr.rqrsr\r^r�r�r��	ZtheZquickZbrown�foxZjumpedZoverr8ZlazyZdog�<r�z�namespace(the=0,
          quick=1,
          brown=2,
          fox=3,
          jumped=4,
          over=5,
          a=6,
          lazy=7,
          dog=8)r�r�rrr	�test_simple_namespace�s�z#QueryTestCase.test_simple_namespacecCsJGdd�dtj�}|ddddddd	d
dd�	}tj|d
d�}|�|d�dS)Nc@r)zGQueryTestCase.test_simple_namespace_subclass.<locals>.AdvancedNamespaceNrrrrr	�AdvancedNamespace�sr�rr.rqrsr\r^r�r�r�r�r�rhz�AdvancedNamespace(the=0,
                  quick=1,
                  brown=2,
                  fox=3,
                  jumped=4,
                  over=5,
                  a=6,
                  lazy=7,
                  dog=8)r�)rr�r�r�rrr	�test_simple_namespace_subclass�s�z,QueryTestCase.test_simple_namespace_subclasscCs(t�dd��}t�|�}|�|d�dS)NZMyDataclassrz
MyDataclass())r6Zmake_dataclassrir�r��rZdcr�rrr	�test_empty_dataclass�r�z"QueryTestCase.test_empty_dataclasscCs$tdd�}t�|�}|�|d�dS)N�text�{z3dataclass1(field1='text', field2=123, field3=False))r,rir�r�r�rrr	�test_small_dataclass�s

z"QueryTestCase.test_small_dataclasscCs4tdtd�d�}tj||gddd�}|�|d�dS)Nzsome fairly long textg _�BTr�r\r�z�[   dataclass1(field1='some fairly long text',
               field2=10000000000,
               field3=True),
    dataclass1(field1='some fairly long text',
               field2=10000000000,
               field3=True)])r,r4rir�r�r�rrr	�test_larger_dataclass�sz#QueryTestCase.test_larger_dataclasscC�$t�}tj|dd�}|�|d�dS)N�rhr:)r7rir�r�r�rrr	�test_dataclass_with_repr
�z&QueryTestCase.test_dataclass_with_reprcCr�)Nr�rhz+<test.test_pprint.dataclass3 object at \w+>)r<rir�ZassertRegexr�rrr	�test_dataclass_no_reprr�z$QueryTestCase.test_dataclass_no_reprcCs,td�}||_tj|dd�}|�|d�dS)Nr�rhz!dataclass4(a=...,
           b=1))r=r8rir�r�r�rrr	�test_recursive_dataclasssz&QueryTestCase.test_recursive_dataclasscCs:td�}td�}||_||_tj|dd�}|�|d�dS)Nr�rhzLdataclass5(a=dataclass6(c=...,
                        d=1),
           b=1))rBrCr8rDrir�r�)rZdc5Zdc6r�rrr	�test_cyclic_dataclasssz#QueryTestCase.test_cyclic_dataclasscCsbddd�}d}t�}|�|�|�|�dg}d}|�|�|�|�dg}d}|�|�|�|�dS)	Nz should be presented using repr()z	like.this)znames with spaceszothers.should.not.bez[{'names with spaces': 'should be presented using repr()',
 others.should.not.be: like.this}z
with spacez['with space']z
without.spacez[without.space])�DottedPrettyPrinterr�r�)rr�r�Zdotted_printerr�Zexp1r�Zexp2rrr	�test_subclassing's�zQueryTestCase.test_subclassingcCs|�t�t��d�|�t�ttd���d�|�tjttd��dd�d�|�tjttd��dd�d�|�tjttd��dd�d	�|�t�t��d
�|�t�ttd���d�|�tjttd��dd�d�|�tjttd��dd�d
�|�tjt	td��dd�d�dS)Nzset()rsz	{0, 1, 2}r�r�rhz{0,
 1,
 2,
 3,
 4,
 5,
 6}z?set2({0,
      1,
      2,
      3,
      4,
      5,
      6})zset3({0, 1, 2, 3, 4, 5, 6})zfrozenset()zfrozenset({0, 1, 2})zbfrozenset({0,
           1,
           2,
           3,
           4,
           5,
           6})zifrozenset2({0,
            1,
            2,
            3,
            4,
            5,
            6})z!frozenset3({0, 1, 2, 3, 4, 5, 6}))
r�rir�r"rZr r!r&r$r%rrrr	�test_set_reprs:s ���zQueryTestCase.test_set_reprscCsHd}tj�d�}|�t�|�|�d}tj�|�}|�t�|�|�dS)NaE{frozenset(): frozenset({frozenset({2}), frozenset({0}), frozenset({1})}),
 frozenset({0}): frozenset({frozenset(),
                            frozenset({0, 2}),
                            frozenset({0, 1})}),
 frozenset({1}): frozenset({frozenset(),
                            frozenset({1, 2}),
                            frozenset({0, 1})}),
 frozenset({2}): frozenset({frozenset(),
                            frozenset({1, 2}),
                            frozenset({0, 2})}),
 frozenset({1, 2}): frozenset({frozenset({2}),
                               frozenset({1}),
                               frozenset({0, 1, 2})}),
 frozenset({0, 2}): frozenset({frozenset({2}),
                               frozenset({0}),
                               frozenset({0, 1, 2})}),
 frozenset({0, 1}): frozenset({frozenset({0}),
                               frozenset({1}),
                               frozenset({0, 1, 2})}),
 frozenset({0, 1, 2}): frozenset({frozenset({1, 2}),
                                  frozenset({0, 2}),
                                  frozenset({0, 1})})}rsaK5{frozenset({frozenset({0, 2}), frozenset({0})}): frozenset({frozenset({frozenset({0,
                                                                                  2}),
                                                                       frozenset({0,
                                                                                  1,
                                                                                  2})}),
                                                            frozenset({frozenset({0}),
                                                                       frozenset({0,
                                                                                  1})}),
                                                            frozenset({frozenset(),
                                                                       frozenset({0})}),
                                                            frozenset({frozenset({2}),
                                                                       frozenset({0,
                                                                                  2})})}),
 frozenset({frozenset({0, 1}), frozenset({1})}): frozenset({frozenset({frozenset({0,
                                                                                  1}),
                                                                       frozenset({0,
                                                                                  1,
                                                                                  2})}),
                                                            frozenset({frozenset({0}),
                                                                       frozenset({0,
                                                                                  1})}),
                                                            frozenset({frozenset({1}),
                                                                       frozenset({1,
                                                                                  2})}),
                                                            frozenset({frozenset(),
                                                                       frozenset({1})})}),
 frozenset({frozenset({1, 2}), frozenset({1})}): frozenset({frozenset({frozenset({1,
                                                                                  2}),
                                                                       frozenset({0,
                                                                                  1,
                                                                                  2})}),
                                                            frozenset({frozenset({2}),
                                                                       frozenset({1,
                                                                                  2})}),
                                                            frozenset({frozenset(),
                                                                       frozenset({1})}),
                                                            frozenset({frozenset({1}),
                                                                       frozenset({0,
                                                                                  1})})}),
 frozenset({frozenset({1, 2}), frozenset({2})}): frozenset({frozenset({frozenset({1,
                                                                                  2}),
                                                                       frozenset({0,
                                                                                  1,
                                                                                  2})}),
                                                            frozenset({frozenset({1}),
                                                                       frozenset({1,
                                                                                  2})}),
                                                            frozenset({frozenset({2}),
                                                                       frozenset({0,
                                                                                  2})}),
                                                            frozenset({frozenset(),
                                                                       frozenset({2})})}),
 frozenset({frozenset(), frozenset({0})}): frozenset({frozenset({frozenset({0}),
                                                                 frozenset({0,
                                                                            1})}),
                                                      frozenset({frozenset({0}),
                                                                 frozenset({0,
                                                                            2})}),
                                                      frozenset({frozenset(),
                                                                 frozenset({1})}),
                                                      frozenset({frozenset(),
                                                                 frozenset({2})})}),
 frozenset({frozenset(), frozenset({1})}): frozenset({frozenset({frozenset(),
                                                                 frozenset({0})}),
                                                      frozenset({frozenset({1}),
                                                                 frozenset({1,
                                                                            2})}),
                                                      frozenset({frozenset(),
                                                                 frozenset({2})}),
                                                      frozenset({frozenset({1}),
                                                                 frozenset({0,
                                                                            1})})}),
 frozenset({frozenset({2}), frozenset()}): frozenset({frozenset({frozenset({2}),
                                                                 frozenset({1,
                                                                            2})}),
                                                      frozenset({frozenset(),
                                                                 frozenset({0})}),
                                                      frozenset({frozenset(),
                                                                 frozenset({1})}),
                                                      frozenset({frozenset({2}),
                                                                 frozenset({0,
                                                                            2})})}),
 frozenset({frozenset({0, 1, 2}), frozenset({0, 1})}): frozenset({frozenset({frozenset({1,
                                                                                        2}),
                                                                             frozenset({0,
                                                                                        1,
                                                                                        2})}),
                                                                  frozenset({frozenset({0,
                                                                                        2}),
                                                                             frozenset({0,
                                                                                        1,
                                                                                        2})}),
                                                                  frozenset({frozenset({0}),
                                                                             frozenset({0,
                                                                                        1})}),
                                                                  frozenset({frozenset({1}),
                                                                             frozenset({0,
                                                                                        1})})}),
 frozenset({frozenset({0}), frozenset({0, 1})}): frozenset({frozenset({frozenset(),
                                                                       frozenset({0})}),
                                                            frozenset({frozenset({0,
                                                                                  1}),
                                                                       frozenset({0,
                                                                                  1,
                                                                                  2})}),
                                                            frozenset({frozenset({0}),
                                                                       frozenset({0,
                                                                                  2})}),
                                                            frozenset({frozenset({1}),
                                                                       frozenset({0,
                                                                                  1})})}),
 frozenset({frozenset({2}), frozenset({0, 2})}): frozenset({frozenset({frozenset({0,
                                                                                  2}),
                                                                       frozenset({0,
                                                                                  1,
                                                                                  2})}),
                                                            frozenset({frozenset({2}),
                                                                       frozenset({1,
                                                                                  2})}),
                                                            frozenset({frozenset({0}),
                                                                       frozenset({0,
                                                                                  2})}),
                                                            frozenset({frozenset(),
                                                                       frozenset({2})})}),
 frozenset({frozenset({0, 1, 2}), frozenset({0, 2})}): frozenset({frozenset({frozenset({1,
                                                                                        2}),
                                                                             frozenset({0,
                                                                                        1,
                                                                                        2})}),
                                                                  frozenset({frozenset({0,
                                                                                        1}),
                                                                             frozenset({0,
                                                                                        1,
                                                                                        2})}),
                                                                  frozenset({frozenset({0}),
                                                                             frozenset({0,
                                                                                        2})}),
                                                                  frozenset({frozenset({2}),
                                                                             frozenset({0,
                                                                                        2})})}),
 frozenset({frozenset({1, 2}), frozenset({0, 1, 2})}): frozenset({frozenset({frozenset({0,
                                                                                        2}),
                                                                             frozenset({0,
                                                                                        1,
                                                                                        2})}),
                                                                  frozenset({frozenset({0,
                                                                                        1}),
                                                                             frozenset({0,
                                                                                        1,
                                                                                        2})}),
                                                                  frozenset({frozenset({2}),
                                                                             frozenset({1,
                                                                                        2})}),
                                                                  frozenset({frozenset({1}),
                                                                             frozenset({1,
                                                                                        2})})})})�testZtest_set�cuber�rir�Z	linegraph)rZ
cube_repr_tgtr�Z
cubo_repr_tgtZcuborrr	�test_set_of_sets_reprsfsz$QueryTestCase.test_set_of_sets_reprscCs�d}dddddddiiiiii}ddddddggggggg}|�t�|�t|��|�t�|�t|��|�t�|�t|��d}d	}d
}|�tj|dd�|�|�tj|dd�|�|�tj|dd�|�dS)N)r.)rq)rs)r\)r^r�r.rqrsr\r^r�z
(1, (...))z
{1: {...}}z
[1, [...]]rg)r�rir�r0)rZnested_tupleZnested_dictZnested_listZ	lv1_tupleZlv1_dictZlv1_listrrr	�
test_depth:szQueryTestCase.test_depthc	Cs d}dd�t|�D�}t�|�t|td�}dd�}|�|t�t|���dd�	t
t|��d	�|�|t�t|���d
d�	t
t|��d�|�|t�t
�|���dd�	dd
�|D��d	�|�t�tdddi�dtt�d�ddg}|�t�t
�|d��dtt|td���dS)Nr�cSsg|]}t��qSr)rF��.0�irrr	�
<listcomp>Lsz>QueryTestCase.test_sort_unorderable_values.<locals>.<listcomp>)�keycSs|�dd��dd�S)Nr�r�r�)r�)�srrr	�<lambda>Osz<QueryTestCase.test_sort_unorderable_values.<locals>.<lambda>�{�,�}zfrozenset({z})css�|]}d|VqdS)z%r:NoneNr)r��krrr	�	<genexpr>Vs�z=QueryTestCase.test_sort_unorderable_values.<locals>.<genexpr>rr.z{1: 0, z: 0})r.rz{%r: 0, %r: 0})rZ�random�shuffle�sortedrGr�rir�r"r�r�r0r&r*r�rFr)r�n�keysZskeysZcleanrrr	�test_sort_unorderable_valuesIs*
�����z*QueryTestCase.test_sort_unorderable_valuescCs
t�}tt|��}|�||�|�tt|��tt|���|�t||g�||g�|�t||g�||g�|�tj	t
||g�dd�d||f�|�tj	t
||g�dd�d||f�|�tj	t�||g�dd�d||f�|�tj	t�||g�dd�d||f�dS)Nr.rhz	{%r,
 %r}z{%r: None,
 %r: None})
rFrHrKZ
assertLessr2r�r�r�rir�r"r*r�)rr8r>rrr	�*test_sort_orderable_and_unorderable_valuesas$
�
�
�
�z8QueryTestCase.test_sort_orderable_and_unorderable_valuescCsvd}|�tj|dd�d�|�tjd|dd�dd�d	�d
}|�tj|dd�t|��|�tj|dd�d
�|�tj|dd�d�|�tj|gggggdd�d�|�tj|gggggdd�d�|�tj|gggggdd�d�d}|�tj|dd�t|��|�t�d�d�|d9}tdd�D]&}tj||d�}|�t|�|�tj|gd|d�}|�t|�|gd�q�dS)Nr��rh�6('the quick brown '
 'fox jumped over '
 'a lazy dog')r.rqr�r�zW{'a': 1,
 'b': 'the quick brown '
      'fox jumped over '
      'a lazy dog',
 'c': 2}u@Portons dix bons "whiskys"
à l'avocat goujat	 qui fumait au zoo�D�uN('Portons dix bons "whiskys"\n'
 "à l'avocat goujat\t qui "
 'fumait au zoo')r�uV('Portons dix bons '
 '"whiskys"\n'
 "à l'avocat "
 'goujat\t qui '
 'fumait au zoo')�#u^[[[[['Portons dix bons "whiskys"\n'
     "à l'avocat goujat\t qui "
     'fumait au zoo']]]]]un[[[[['Portons dix bons '
     '"whiskys"\n'
     "à l'avocat "
     'goujat\t qui '
     'fumait au zoo']]]]]�uv[[[[['Portons dix '
     'bons "whiskys"\n'
     "à l'avocat "
     'goujat\t qui '
     'fumait au '
     'zoo']]]]]Zdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx�Pr��''r�rsr])r�rir�r0rZr�)rr��specialZunwrappabler`r�rrr	�
test_str_wrapus0��   �zQueryTestCase.test_str_wrapcCsDdd�td�D�dd�td�D�}d}|�tj|ddd	�|�dS)
NcSsg|]
}tt||���qSr�rrZr�rrr	r��sz.QueryTestCase.test_compact.<locals>.<listcomp>r^cSsg|]}tt|���qSrrr�rrr	r��sr�z�[[], [0], [0, 1, 2, 3],
 [0, 1, 2, 3, 4, 5, 6, 7, 8],
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  14, 15],
 [], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3],
 [0, 1, 2, 3, 4]]�/T�r`rc)rZr�rir�)rr�r�rrr	�test_compact�s
�zQueryTestCase.test_compactcCs�d}d}dg|}t|d�D]}|g}qt|dd|d|d�D]!}tj||dd���}ttt|��}|�||�|�||d�q$dS)	Nr�r�rr.rqrsTr	)	rZrir��
splitlines�maxr�rZassertLessEqualZ
assertGreater)rZlevelsZnumberr�r��w�linesZmaxwidthrrr	�test_compact_width�s
"�z QueryTestCase.test_compact_widthcCs�|�tjddd�d�|�tjddd�d�d}|�tj|dd�t|��|�tj|d	d�d
�|�tj|dd�d�|�tj|d
d�d�ttd
��}|�tj|dd�t|��|�tj|dd�d�|�tj|dd�d�|�tj|dd�d�|�tjd|dd�dd�d�|�tjd|dd�dd�d�|�tj|ggggggdd�d�|�tj|ggggggdd�d�tdd�D]&}tj||d�}|�t|�|�tj|gd|d�}|�t|�|gd�q�dS)Nr�r.rhzb''sabcdzb'abcd'�abcdefghijklmnopqrstuvwxyz�r�z$(b'abcdefghijkl'
 b'mnopqrstuvwxyz')�z)(b'abcdefghijkl'
 b'mnopqrstuvwx'
 b'yz')r��=�0zD(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b'
 b'\x0c\r\x0e\x0f')� zI(b'\x00\x01\x02\x03'
 b'\x04\x05\x06\x07\x08\t\n\x0b'
 b'\x0c\r\x0e\x0f')zN(b'\x00\x01\x02\x03'
 b'\x04\x05\x06\x07'
 b'\x08\t\n\x0b'
 b'\x0c\r\x0e\x0f')rqr��zJ{'a': 1,
 'b': b'abcdefghijkl'
      b'mnopqrstuvwx'
      b'yz',
 'c': 2}r�zJ{'a': 1,
 'b': b'abcdefgh'
      b'ijklmnop'
      b'qrstuvwxyz',
 'c': 2}r�z3[[[[[[b'abcdefghijklmnop'
      b'qrstuvwxyz']]]]]]r�zS[[[[[[b'\x00\x01\x02\x03\x04\x05\x06\x07'
      b'\x08\t\n\x0b\x0c\r\x0e\x0f']]]]]]�@)r�rir�r0�bytesrZr�)r�lettersrr`r�rrr	�test_bytes_wrap�s<����""�zQueryTestCase.test_bytes_wrapcCsF|�tjt�dd�d�td�}|�tj|dd�t|��|�tj|dd�d�|�tj|dd�d	�|�tj|d
d�d	�ttd��}|�tj|dd�t|��|�tj|d
d�d�|�tj|dd�d�|�tj|dd�d�|�tjd|dd�dd�d�|�tj|gggggdd�d�|�tj|gggggdd�d�dS)Nr.rhzbytearray(b'')rr]�z6bytearray(b'abcdefghijkl'
          b'mnopqrstuvwxyz')�zDbytearray(b'abcdefghijkl'
          b'mnopqrstuvwx'
          b'yz')r�r��H�9zVbytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b'
          b'\x0c\r\x0e\x0f')r�zdbytearray(b'\x00\x01\x02\x03'
          b'\x04\x05\x06\x07\x08\t\n\x0b'
          b'\x0c\r\x0e\x0f')zrbytearray(b'\x00\x01\x02\x03'
          b'\x04\x05\x06\x07'
          b'\x08\t\n\x0b'
          b'\x0c\r\x0e\x0f')rqr�rzi{'a': 1,
 'b': bytearray(b'abcdefghijkl'
                b'mnopqrstuvwx'
                b'yz'),
 'c': 2}�%zE[[[[[bytearray(b'abcdefghijklmnop'
               b'qrstuvwxyz')]]]]]�2ze[[[[[bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07'
               b'\x08\t\n\x0b\x0c\r\x0e\x0f')]]]]])r�rir�rvr0rZ)rrrrrr	�test_bytearray_wraps$�� $z!QueryTestCase.test_bytearray_wrapcCsTt�t�}|�tj|dd�d�d��}t�tt|t�	���}|�t�|�d�dS)Nr.rhzdefaultdict(<class 'int'>, {})r�z�defaultdict(<class 'int'>,
            {'a': 6,
             'brown': 2,
             'dog': 8,
             'fox': 3,
             'jumped': 4,
             'lazy': 7,
             'over': 5,
             'quick': 1,
             'the': 0}))
r��defaultdictr4r�rir�r�r�r�r�r�rrr	�test_default_dict-s
�zQueryTestCase.test_default_dictcCsBt��}|�tj|dd�d�t�d�}|�tj|dd�d�dS)Nr.rhz	Counter()Z
senselessnessr]zDCounter({'s': 6,
         'e': 4,
         'n': 2,
         'l': 1}))r��Counterr�rir�r�rrr	�test_counter?s
�zQueryTestCase.test_countercCs�t��}|�tj|dd�d�d��}tt|t�	���}t�t
|��}|�t�|�d�t�t
|�t�|��}|�t�|�d�dS)Nr.rhzChainMap({})r�z�ChainMap({'a': 6,
          'brown': 2,
          'dog': 8,
          'fox': 3,
          'jumped': 4,
          'lazy': 7,
          'over': 5,
          'quick': 1,
          'the': 0})a�ChainMap({'a': 6,
          'brown': 2,
          'dog': 8,
          'fox': 3,
          'jumped': 4,
          'lazy': 7,
          'over': 5,
          'quick': 1,
          'the': 0},
         OrderedDict([('the', 0),
                      ('quick', 1),
                      ('brown', 2),
                      ('fox', 3),
                      ('jumped', 4),
                      ('over', 5),
                      ('a', 6),
                      ('lazy', 7),
                      ('dog', 8)])))r��ChainMapr�rir�r�rr�r�r�r*r�)rrEr��itemsrrr	�
test_chainmapJs��zQueryTestCase.test_chainmapcCs�t��}|�tj|dd�d�tjdd�}|�tj|dd�d�d��}t�t|t����}|�t�|�d�tjt|t���dd�}|�t�|�d	�dS)
Nr.rhz	deque([])r�)�maxlenzdeque([], maxlen=7)r�z�deque([('the', 0),
       ('quick', 1),
       ('brown', 2),
       ('fox', 3),
       ('jumped', 4),
       ('over', 5),
       ('a', 6),
       ('lazy', 7),
       ('dog', 8)])z�deque([('brown', 2),
       ('fox', 3),
       ('jumped', 4),
       ('over', 5),
       ('a', 6),
       ('lazy', 7),
       ('dog', 8)],
      maxlen=7))	r��dequer�rir�r�r�r�r�r�rrr	�
test_dequeqs��zQueryTestCase.test_dequecC�Pt��}|�tj|dd�d�d��}t�t|t����}|�t�|�d�dS)Nr.rhz{}r�zi{'a': 6,
 'brown': 2,
 'dog': 8,
 'fox': 3,
 'jumped': 4,
 'lazy': 7,
 'over': 5,
 'quick': 1,
 'the': 0})	r��UserDictr�rir�r�r�r�r�r�rrr	�test_user_dict���zQueryTestCase.test_user_dictcCr,)Nr.rhz[]r�z{[('the', 0),
 ('quick', 1),
 ('brown', 2),
 ('fox', 3),
 ('jumped', 4),
 ('over', 5),
 ('a', 6),
 ('lazy', 7),
 ('dog', 8)])	r��UserListr�rir�r�r�r�r�r�rrr	�test_user_list�r/zQueryTestCase.test_user_listcCs^t�d�}|�tj|dd�d�t�d�}|�tj|dd�d�|�tjd|idd�d�dS)	Nr�r.rhrr�r�r�zF{1: 'the quick '
    'brown fox '
    'jumped over a '
    'lazy dog'})r��
UserStringr�rir�r�rrr	�test_user_string�s

��zQueryTestCase.test_user_stringN)4rrrr[rpr|rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��unittestZexpectedFailurer��supportZcpython_onlyr�r�r�r�rr
rrr!r#r%r(r+r.r1r3rrrr	rW}s`
!#$&,R<9+'rWc@r)r�cCs>t|t�rd|vrt|�ddfS|ddfStj�|||||�S)Nr�r.r)�
isinstancer2r0rirj�format)r�object�context�	maxlevels�levelrrr	r7�s


�zDottedPrettyPrinter.formatN)rrrr7rrrr	r��sr��__main__).r�r6rkr�rir�Ztest.supportr�Z
test.test_setr�r4rrrrrrrrr"r r!r#r&r$r%r'r*r(r)r+Z	dataclassr,r7r<r=rBrCrFrHZTestCaserWrjr�r�mainrrrr	�<module>sh
M

�
© 2025 GrazzMean