HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_pprint.cpython-37.pyc
B

��g���@s>ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	Gdd�de
�ZGdd�de
�ZGdd�de
�ZGdd	�d	e
�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd�d�ZGdd�de	j�ZGdd�dej�Zedk�r:e	� �dS)�Nc@seZdZdS)�list2N)�__name__�
__module__�__qualname__�rr�,/usr/local/lib/python3.7/test/test_pprint.pyrsrc@seZdZdd�ZdS)�list3cCs
t�|�S)N)�list�__repr__)�selfrrrr
szlist3.__repr__N)rrrr
rrrrrsrc@seZdZdS)�tuple2N)rrrrrrrrsrc@seZdZdd�ZdS)�tuple3cCs
t�|�S)N)�tupler
)rrrrr
sztuple3.__repr__N)rrrr
rrrrr
sr
c@seZdZdS)�set2N)rrrrrrrrsrc@seZdZdd�ZdS)�set3cCs
t�|�S)N)�setr
)rrrrr
 sz
set3.__repr__N)rrrr
rrrrrsrc@seZdZdS)�
frozenset2N)rrrrrrrr#src@seZdZdd�ZdS)�
frozenset3cCs
t�|�S)N)�	frozensetr
)rrrrr
'szfrozenset3.__repr__N)rrrr
rrrrr&src@seZdZdS)�dict2N)rrrrrrrr*src@seZdZdd�ZdS)�dict3cCs
t�|�S)N)�dictr
)rrrrr
.szdict3.__repr__N)rrrr
rrrrr-src@seZdZdd�ZdS)�UnorderablecCstt|��S)N)�str�id)rrrrr
2szUnorderable.__repr__N)rrrr
rrrrr1src@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�	OrderablecCs
||_dS)N)�_hash)r�hashrrr�__init__7szOrderable.__init__cCsdS)NFr)r�otherrrr�__lt__9szOrderable.__lt__cCs||kS)Nr)rrrrr�__gt__;szOrderable.__gt__cCs||kS)Nr)rrrrr�__le__=szOrderable.__le__cCsdS)NTr)rrrrr�__ge__?szOrderable.__ge__cCs||kS)Nr)rrrrr�__eq__AszOrderable.__eq__cCs||k	S)Nr)rrrrr�__ne__CszOrderable.__ne__cCs|jS)N)r)rrrr�__hash__EszOrderable.__hash__N)rrrrr r!r"r#r$r%r&rrrrr6src@s
eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zejejjdd���Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Z d3d4�Z!d5d6�Z"d7d8�Z#d9d:�Z$d;d<�Z%d=S)>�
QueryTestCasecCs,ttd��|_ttd��|_|j|jd<dS)N�d��i�)r	�range�a�b)rrrr�setUpJszQueryTestCase.setUpc	Cs�t��}tjdddt��dd�}t�dddt���}|�t��t�dddt��d�}WdQRX|jttjdd�|jttjdd	�|jttjdd	�|jttjdd
�dS)N��(�T)�indent�width�depth�stream�compact���)r1r)r3)r2)�pprint�
PrettyPrinter�io�StringIOZassertRaises�	TypeError�
ValueError)r�pprrr�	test_initOs
 zQueryTestCase.test_initcCs�t��}x�dddddgdddidtd�d	d
dd|j|jfD]d}|�t�|�d|f�|�t�|�d
|f�|�|�|�d|f�|�|�|�d
|f�q:WdS)N�g@y@�abc�)r?r?sdefsghiTF.zexpected not isrecursive for %rzexpected isreadable for %r)	r7r8�	bytearrayr+r,�assertFalse�isrecursive�
assertTrue�
isreadable)rr=�saferrr�
test_basic[szQueryTestCase.test_basiccCsP|j|jd<i|_|j|jd<|jd<|jd<t��}xj|j|j|j|j|jffD]L}|�t�|�d�|�t�|�d�|�|�|�d�|�|�|�d�qVW|j�	�|jdd�=|jdd�=x�|j|j|j|j|jffD]d}|�t�|�d|f�|�t�|�d|f�|�|�|�d|f�|�|�|�d|f�q�WdS)	N�Cr�r?zexpected isrecursivezexpected not isreadablezexpected not isrecursive for %rzexpected isreadable for %r)
r+r,�dr7r8rErDrCrF�clear)rr=ZickyrGrrr�test_knottedls*  
 zQueryTestCase.test_knottedcCs�t��}xxtd�ttjfD]d}|�t�|�d|f�|�t�|�d|f�|�|�|�d|f�|�|�|�d|f�qWdS)NrAzexpected not isrecursive for %rzexpected not isreadable for %r)r7r8�typerDrCrF)rr=Z
unreadablerrr�test_unreadable�szQueryTestCase.test_unreadablec9Csj�xbddddddt�dt�t�gt�t�t�t�t�t�t	�t
�it�t�|j
tdddd	d
dtd�dd
gd
didd
dgdditd�td�ttd��d
dgtd
dg�td
dg�ttd��tdh�tdh�tdh�tdh�t	dh�t
dh�tddi�tddi�tddd�ddddf9D]R}t|�}|�t�|�|�|�tj|ddd��dd�|�|�t�|�|��qWdS)Nryg��ri����y��g���x�x)rArA�)rJr?r.r0r(���
i����r6TF.rJ)r2r1�
� )rBrr
rrrrrrrrrrrEr7r*�repr�assertEqual�pformat�replaceZsaferepr)rZsimpleZnativerrr�test_same_as_repr�s,	


$
zQueryTestCase.test_same_as_reprcCsdddddddd�}d}x&ttgD]}|�t�||��|�q"Wtd�}dd�tt|��}x&t	t
gD]}|�t�||��|�qfWttd��}d	d�tt|��}x&ttgD]}|�t�||��|�q�Wtd�}d
d�tt|��}x*t	t
gD]}|�tj||�dd
�|�q�WdS)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}r(z[%s]z,
 z(%s)z[   %s]z,
    r.)r1)
rrr[r7r\r*�join�maprr	rrr)r�o�exprNrrr�test_basic_line_wrap�s,z"QueryTestCase.test_basic_line_wrapcCs^ttd��}tdddd�}||g}d}|�tj|ddd	�|�d
}|�tj|ddd	�|�dS)NrWrJr?rA)�first�secondZthirdzN[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    {'first': 1, 'second': 2, 'third': 3}]r.�*)r1r2za[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    {   'first': 1,
        'second': 2,
        'third': 3}]�))r	r*rr[r7r\)rZo1Zo2ra�expectedrrr�test_nested_indentations�s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']]]]]�)r2���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[r7r\)rrhrarrr�
test_width�s
zQueryTestCase.test_widthcCsTdddd�}|�t�|�d�|�t�||g�d�|�t�dggid��d�dS)NrJ)r+r,�cz{'a': 1, 'b': 1, 'c': 1}z4[{'a': 1, 'b': 1, 'c': 1}, {'a': 1, 'b': 1, 'c': 1}])rA)zxy	ab
r0rz#{5: [[]], 'xy\tab\n': (3,), (): {}})r[r7r\)rrKrrr�test_sorted_dictszQueryTestCase.test_sorted_dictcCspt��}|�tj|dd�d�t�g�}|�tj|dd�d�d��}t�t|t����}|�t�|�d�dS)NrJ)r2z
OrderedDict()z*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[r7r\�split�zip�	itertools�count)rrK�wordsrrr�test_ordered_dict(s

zQueryTestCase.test_ordered_dictcCsjd��}tt|t����}t�|�}|�t�	|�d�t
�t|t����}t�|�}|�t�	|�d�dS)Nz*the quick brown fox jumped over a lazy dogz�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)])))rtrrurvrw�types�MappingProxyTyper[r7r\rrrs)rrxrK�mrrr�test_mapping_proxy;s
	
	z QueryTestCase.test_mapping_proxycCs&ddd�}d}|�t��|�|�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})r[�DottedPrettyPrinterr\)rrarbrrr�test_subclassingVszQueryTestCase.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()rAz	{0, 1, 2}rU�)r2z{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[r7r\rr*rrrrr)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})})}rAaK5{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[r7r\Z	linegraph)rZ
cube_repr_tgtr�Z
cubo_repr_tgtZcuborrr�test_set_of_sets_reprs�s0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)rJ)r?)rA)r.)r0rTrJr?rAr.r0rTz
(1, (...))z
{1: {...}}z
[1, [...]])r3)r[r7r\rZ)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)r)�.0�irrr�
<listcomp>psz>QueryTestCase.test_sort_unorderable_values.<locals>.<listcomp>)�keycSs|�dd��dd�S)NrYrPrX)r])�srrr�<lambda>srQz<QueryTestCase.test_sort_unorderable_values.<locals>.<lambda>�{�,�}zfrozenset({z})css|]}d|VqdS)z%r:NoneNr)r��krrr�	<genexpr>zsz=QueryTestCase.test_sort_unorderable_values.<locals>.<genexpr>rrJz{1: 0, z: 0})rJ)Nz{%r: 0, %r: 0})r*�randomZshuffle�sortedrr[r7r\rr_r`rZrr�fromkeysrr)r�n�keysZskeysZcleanrrr�test_sort_unorderable_valuesms 
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)NrJ)r2z	{%r,
 %r}z{%r: None,
 %r: None})
rrrZ
assertLessrrNr[r�r7r\rrr�)rr+r,rrr�*test_sort_orderable_and_unorderable_values�sz8QueryTestCase.test_sort_orderable_and_unorderable_valuescCs|d}|�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}x\tdd�D]N}tj||d�}|�t|�|�tj|gd|d�}|�t|�|gd��q&WdS)Nz*the quick brown fox jumped over a lazy dog�)r2z6('the quick brown '
 'fox jumped over '
 'a lazy dog')rJr?)r+r,rprlzW{'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�PrPz''rWrAr/)r[r7r\rZr*rn)rZfox�specialZunwrappabler2�	formattedrrr�
test_str_wrap�s6zQueryTestCase.test_str_wrapcCsDdd�td�D�dd�td�D�}d}|�tj|ddd	�|�dS)
NcSsg|]}tt||���qSr)r	r*)r�r�rrrr��sz.QueryTestCase.test_compact.<locals>.<listcomp>r0cSsg|]}tt|���qSr)r	r*)r�r�rrrr��srTz�[[], [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)r2r5)r*r[r7r\)rrarhrrr�test_compact�szQueryTestCase.test_compactcCs�d}d}dg|}xt|d�D]
}|g}q Wxdt|dd|d|d�D]B}tj||dd���}ttt|��}|�||�|�||d�qNWdS)	Nr�rWrrJr?rAT)r2r5)	r*r7r\�
splitlines�maxr`�lenZassertLessEqualZ
assertGreater)rZlevelsZnumberrar��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�x\tdd�D]N}tj||d�}|�t|�|�tj|gd|d�}|�t|�|gd��q�WdS)NrQrJ)r2zb''sabcdzb'abcd'sabcdefghijklmnopqrstuvwxyz�r�z$(b'abcdefghijkl'
 b'mnopqrstuvwxyz')�z)(b'abcdefghijkl'
 b'mnopqrstuvwx'
 b'yz')rk�=�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')r?)r+r,rp�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}rlz3[[[[[[b'abcdefghijklmnop'
      b'qrstuvwxyz']]]]]]rgzS[[[[[[b'\x00\x01\x02\x03\x04\x05\x06\x07'
      b'\x08\t\n\x0b\x0c\r\x0e\x0f']]]]]]�@)r[r7r\rZ�bytesr*rn)r�lettersr�r2r�rrr�test_bytes_wrap�sB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)NrJ)r2zbytearray(b'')sabcdefghijklmnopqrstuvwxyzr/�z6bytearray(b'abcdefghijkl'
          b'mnopqrstuvwxyz')�zDbytearray(b'abcdefghijkl'
          b'mnopqrstuvwx'
          b'yz')rlrk�H�9zVbytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b'
          b'\x0c\r\x0e\x0f')rgzdbytearray(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')r?)r+r,rpr�zi{'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[r7r\rBrZr*)rr�r�rrr�test_bytearray_wrap&s0z!QueryTestCase.test_bytearray_wrapcCsTt�t�}|�tj|dd�d�d��}t�tt|t�	���}|�t�|�d�dS)NrJ)r2zdefaultdict(<class 'int'>, {})z*the quick brown fox jumped over a lazy dogz�defaultdict(<class 'int'>,
            {'a': 6,
             'brown': 2,
             'dog': 8,
             'fox': 3,
             'jumped': 4,
             'lazy': 7,
             'over': 5,
             'quick': 1,
             'the': 0}))
rr�defaultdict�intr[r7r\rtrurvrw)rrKrxrrr�test_default_dictQs
zQueryTestCase.test_default_dictcCsBt��}|�tj|dd�d�t�d�}|�tj|dd�d�dS)NrJ)r2z	Counter()Z
senselessnessr/zDCounter({'s': 6,
         'e': 4,
         'n': 2,
         'l': 1}))rr�Counterr[r7r\)rrKrrr�test_countercs

zQueryTestCase.test_countercCs�t��}|�tj|dd�d�d��}tt|t�	���}t�t
|��}|�t�|�d�t�t
|�t�|��}|�t�|�d�dS)NrJ)r2zChainMap({})z*the quick brown fox jumped over a lazy dogz�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)])))rr�ChainMapr[r7r\rtr	rurvrwrrs)rrKrx�itemsrrr�
test_chainmapns
zQueryTestCase.test_chainmapcCs�t��}|�tj|dd�d�tjdd�}|�tj|dd�d�d��}t�t|t����}|�t�|�d�tjt|t���dd�}|�t�|�d	�dS)
NrJ)r2z	deque([])rU)�maxlenzdeque([], maxlen=7)z*the quick brown fox jumped over a lazy dogz�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))	rr�dequer[r7r\rtrurvrw)rrKrxrrr�
test_deque�s
	zQueryTestCase.test_dequecCsPt��}|�tj|dd�d�d��}t�t|t����}|�t�|�d�dS)NrJ)r2z{}z*the quick brown fox jumped over a lazy dogzi{'a': 6,
 'brown': 2,
 'dog': 8,
 'fox': 3,
 'jumped': 4,
 'lazy': 7,
 'over': 5,
 'quick': 1,
 'the': 0})	rr�UserDictr[r7r\rtrurvrw)rrKrxrrr�test_user_dict�s
zQueryTestCase.test_user_dictcCsPt��}|�tj|dd�d�d��}t�t|t����}|�t�|�d�dS)NrJ)r2z[]z*the quick brown fox jumped over a lazy dogz{[('the', 0),
 ('quick', 1),
 ('brown', 2),
 ('fox', 3),
 ('jumped', 4),
 ('over', 5),
 ('a', 6),
 ('lazy', 7),
 ('dog', 8)])	rr�UserListr[r7r\rtrurvrw)rrKrxrrr�test_user_list�s
zQueryTestCase.test_user_listcCs^t�d�}|�tj|dd�d�t�d�}|�tj|dd�d�|�tjd|idd�d�dS)	NrPrJ)r2z''z*the quick brown fox jumped over a lazy dogr�z6('the quick brown '
 'fox jumped over '
 'a lazy dog')zF{1: 'the quick '
    'brown fox '
    'jumped over a '
    'lazy dog'})rr�
UserStringr[r7r\)rrKrrr�test_user_string�s

zQueryTestCase.test_user_stringN)&rrrr-r>rHrMrOr^rcrirorqryr}rr��unittestZexpectedFailurer�ZsupportZcpython_onlyr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr'Hs@!!$&,S<9+'r'c@seZdZdd�ZdS)r~cCsDt|t�r,d|kr t|�ddfS|ddfSntj�|||||�SdS)NrYrJr)�
isinstancerrZr7r8�format)r�object�context�	maxlevels�levelrrrr��s
zDottedPrettyPrinter.formatN)rrrr�rrrrr~�sr~�__main__)!rrr9rvr7r�Ztest.supportr�Z
test.test_setrzr�r	rrrrr
rrrrrrrrrrrZTestCaser'r8r~r�mainrrrr�<module>s>%