Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_graphlib.cpython-312.opt-1.pyc

�

'ΜgA!���ddlZddlZddlZddlmZGd�dej
�Zedk(rej�yy)�N)�assert_python_okc�r�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zy)�TestTopologicalSortc�b�d�}tj|�}|jt||��t|��tj|�}t	|j��}|D]5}|D�chc]
}t
|���}}|jt|�|��7ycc}w)Nc3��K�|j�|j�rP|j�}|D]}|j|��t	t|����|j�r�Oyy�w�N)�prepare�	is_active�	get_ready�done�tuple�sorted)�ts�nodes�nodes   �//usr/local/lib/python3.12/test/test_graphlib.py�static_order_with_groupszATestTopologicalSort._test_graph.<locals>.static_order_with_groups	sR�����J�J�L��,�,�.������!�D��G�G�D�M�"��F�5�M�*�*�	�,�,�.�s�A/A4�2A4)�graphlib�TopologicalSorter�assertEqual�list�iter�static_order�next�set)	�self�graph�expectedrr�it�group�element�tsgroups	         r�_test_graphzTestTopologicalSort._test_graphs���	+��
'�
'��
.������6�r�:�;�T�(�^�L�
�
'�
'��
.���"�/�/�#�
$���E�/4�5�u�G�t�B�x�u�G�5����S��Z��1���5s�:B,c��tj�}|j�D]\}}|j|g|����	|j	��#tj
$rh}|j\}}|jdjtt|��djtt|dz���Yd}~yd}~wwxYw)N� �)rr�items�addr	�
CycleError�args�assertIn�join�map�str)	rr�cyclerr�	dependson�e�_�seqs	         r�
_assert_cyclez!TestTopologicalSort._assert_cycles���
�
'�
'�
)��$�{�{�}�O�D�)��B�F�F�4�$�)�$� -�	��J�J�L�

��	�"�"�	R��V�V�F�A�s��M�M�#�(�(�3�s�E�?�3�S�X�X�c�#�s�Q�w�>O�5P�Q�Q��	R�s�A�C
�%AC�C
c
�0�|jdhddhddhddhddhd�gd��|jdiid	g�|jtd
�D�cic]	}||dzh��c}td
dd�D�cgc]}|f��c}�|jdhdhdhdhd
hdhdhdhd�gd��|jddgdgddgdgdgdgdgdgdggd�
gd��|jddggdggd�gd��|jddggdggdgdggd�gd��ycc}wcc}w)N�����)r&�	�
r6r7))r8r:r9)r7r6)r&r;r<��r=r<������
��)r&r8r@r:r6rArBrC))r=rD)r:rC)r@rB)r8rA)r&r6r&�r;)
rr=r&r8r@r:rEr9r7r;))r;)r@)r8r7)r=r:r9)rE�r&�r)rr=r&r8))r=r8rFrG)rr=r&r8r@r:rE))r=r8rE)r&r:)rr@)r#�range)r�xs  r�test_simple_casesz%TestTopologicalSort.test_simple_cases)st�������"�a��r�1�g�A�q�6�q�!�f�E�,�	
�
	
���!�R��4�&�)����!&�r��+��A�Q��Q���Z��+�E�"�b�"�<M�-N�<M�q�q�d�<M�-N�	
�	
�����������"��B�4�b�T�PR�t�T�9�	
�
	
����q�6��3��q�6��3��3��3��3��3��3��
�
>�	
� 	
���a��V���s�r�:�<P�Q�����A��2�1�#�"�!��!���D�'�	
��5
,��-Ns�D�0
D
c��|jdhdhdhd�ddg�|jt�t�t�d�dg�y)Nr&r@rE)r=r8r:)r&r@rE)r#r�rs r�test_no_dependenciesz(TestTopologicalSort.test_no_dependenciesQsC�����a�S�a�S�a�S�1�I�y�3I�J����S�U�s�u���7�)��E�c��|jdhdhgd�d�ddg�tj�}|jdd�|jdd�|jdd�|j	g|j��ddg�y)Nr&r@)r&r@r@r@r@r@)r=r8r)r&r@)rr=r8r=)r#rrr(rr�rrs  r�test_the_node_multiple_timesz0TestTopologicalSort.test_the_node_multiple_timesVs{�����a�S�a�S�-?�@�6�9�BU�V��
'�
'�
)��
���q�!��
���q�!��
���q�!�����-�2�?�?�,�-��1�v�6rNc��d�td�D�}tjd|i�}|jt	|j��gd��y)Nc3�,K�|]}d|zdz���y�w)r&r=N�)�.0rIs  r�	<genexpr>z@TestTopologicalSort.test_graph_with_iterables.<locals>.<genexpr>bs����1��1�Q��U�Q�Y��s�r:r)r=r8r:r9r;r)rHrrrrr)rr0rs   r�test_graph_with_iterablesz-TestTopologicalSort.test_graph_with_iterablesasA��1��a��1�	�
�
'�
'��I��
7������b�o�o�/�0�2D�ErNc�R�tj�}|jdd�|jdd�|jdd�|jdd�tjdhd�i�}|jg|j	��g|j	���y)Nr=r&r8r@r:>r&r8r@r:)rrr(rr)rr�ts2s   r�1test_add_dependencies_for_same_node_incrementallyzETestTopologicalSort.test_add_dependencies_for_same_node_incrementallyfs���
�
'�
'�
)��
���q�!��
���q�!��
���q�!��
���q�!���(�(�!�\�):�;�����-�2�?�?�,�-�/D��1A�1A�1C�/D�ErNc�(�|jig�yr)r#rLs r�
test_emptyzTestTopologicalSort.test_emptyqs������R� rNc	�V�|jddhiddg�|jdhdhd�gd��|jdhdhdhd�gd��|jdhdhdhdhd	hd
�gd��|jdhdhdhdhdhd	hd
�gd��|jdhdhddhdhd�ddg�y)Nr=r&)r=r&)r=r&r=r8)r=r&r8)r=r8r&r=r@rE)r=r&r8r:r@r:r9)r=r&r8r@rEr9)r=r&r8r@)r4rLs r�
test_cyclezTestTopologicalSort.test_cyclets������A��s�8�a��V�,�����s��s�+�Y�7�����s��s��s�3�\�B�����s��s��s��s��s�C�\�R�����s��s��s��s��s��s�K�Y�W�����s��s��1�v�1�#�>��A��GrNc��tj�}|jtd�5|j	�ddd�|jtd�5|jd�ddd�|jtd�5|j
�ddd�y#1swY�ixYw#1swY�ExYw#1swYyxYw)Nz prepare\(\) must be called firstr8)rr�assertRaisesRegex�
ValueErrorrrr
rPs  r�test_calls_before_preparez-TestTopologicalSort.test_calls_before_prepare�s���
�
'�
'�
)��
�
#�
#�J�0S�
T��L�L�N�U�
�
#�
#�J�0S�
T��G�G�A�J�U�
�
#�
#�J�0S�
T��L�L�N�U�
T�	U�
T��
T�
T��
T�
T�s#�B$�B0�
B<�$B-�0B9�<Cc���tj�}|j�|jtd�5|j�ddd�y#1swYyxYw)Nz!cannot prepare\(\) more than once)rrr	r`rarPs  r�test_prepare_multiple_timesz/TestTopologicalSort.test_prepare_multiple_times�s@��
�
'�
'�
)��
�
�
��
�
#�
#�J�0T�
U��J�J�L�V�
U�
U�s�A�Ac��tj�}|jdddd�|jddd�|j�|j	�|jtd�5|jd�ddd�|jtd�5|jd�ddd�y#1swY�:xYw#1swYyxYw)Nr=r&r8r@znode 2 was not passed outz#node 24 was not added using add\(\)�)rrr(r	rr`rarrPs  r�test_invalid_nodes_in_donez.TestTopologicalSort.test_invalid_nodes_in_done�s���
�
'�
'�
)��
���q�!�Q���
���q�!�Q��
�
�
��
����
�
#�
#�J�0K�
L��G�G�A�J�M�
�
#�
#�J�0V�
W��G�G�B�K�X�
W�M�
L��
W�
W�s�2B=�"C	�=C�	Cc��tj�}|jdddd�|jdd�|j�|j	|j�d�|j	|j�d�|j
d�|j	|j�d�|j	|j�d�|j
d�|j
d�|j	|j�d�|j	|j�d�|j
d�|j	|j�d�|j|j��y)	Nr=r&r8r@)r8r@rTrFr>)	rrr(r	rrr�assertFalser
rPs  r�	test_donezTestTopologicalSort.test_done�s��
�
'�
'�
)��
���q�!�Q���
���q�!��
�
�
����������0���������,�
����
���������.���������,�
����
�
����
���������.���������,�
����
���������,��������(rNc�j�tj�}|jdd�|j�|j	|j��|j
|j�d�|j	|j��|jd�|j	|j��|j
|j�d�|j	|j��|jd�|j|j��y)Nr=r&rFr>)
rrr(r	�
assertTruer
rrrrirPs  r�test_is_activez"TestTopologicalSort.test_is_active�s���
�
'�
'�
)��
���q�!��
�
�
���������'���������.��������'�
����
��������'���������.��������'�
����
��������(rNc�8�tj�}|jt|jt�d�|jt|jdt��|jt|jt�t��y)Nr=)rr�assertRaises�	TypeErrorr(�dictrPs  r�test_not_hashable_nodesz+TestTopologicalSort.test_not_hashable_nodes�s`��
�
'�
'�
)�����)�R�V�V�T�V�Q�7����)�R�V�V�Q���7����)�R�V�V�T�V�T�V�<rNc�&�d�}tj�}|jddd�|jdd�|jdd�|jdd	�|jdd	�tj�}|jdd�|jddd�|jdd	�|jdd	�|jdd�|jt	||��t	||���y)
Nc3��K�|j�|j�r>|j�}|j|�t	|���|j�r�=yy�wr)r	r
rrr)rrs  r�
get_groupsz^TestTopologicalSort.test_order_of_insertion_does_not_matter_between_groups.<locals>.get_groups�sE�����J�J�L��,�,�.�������������%�j� ��,�,�.�s�AA"� A"r8r&r=rr@r:rEr9)rrr(rr)rrurrYs    r�6test_order_of_insertion_does_not_matter_between_groupszJTestTopologicalSort.test_order_of_insertion_does_not_matter_between_groups�s���	!��
'�
'�
)��
���q�!�Q��
���q�!��
���q�!��
���q�!��
���q�!���(�(�*������1�
�����1�a������1�
�����1�
�����1�
�����j��n�-�t�J�s�O�/D�ErNc��d�}|d�}|d�}|j|d�|j|d�|j||�y)Nc��d}tjj�}d|d<t|�|d<t	d|fi|��}|S)Naxif 1:
                import graphlib
                ts = graphlib.TopologicalSorter()
                ts.add('blech', 'bluch', 'hola')
                ts.add('abcd', 'blech', 'bluch', 'a', 'b')
                ts.add('a', 'a string', 'something', 'b')
                ts.add('bluch', 'hola', 'abcde', 'a', 'b')
                print(list(ts.static_order()))
                T�
__cleanenv�PYTHONHASHSEEDz-c)�os�environ�copyr.r)�seed�code�env�outs    r�check_order_with_hash_seedzlTestTopologicalSort.test_static_order_does_not_change_with_the_hash_seed.<locals>.check_order_with_hash_seed�sL���D��*�*�/�/�#�C�!%�C���$'��I�C� �!�"�4��5��5�C��JrNi�i�z�)�assertNotEqualr)rr��run1�run2s    r�4test_static_order_does_not_change_with_the_hash_seedzHTestTopologicalSort.test_static_order_does_not_change_with_the_hash_seed�sM��	�$*�$�/��)�%�0�����D�"�%����D�"�%�����t�$rNN)�__name__�
__module__�__qualname__r#r4rJrMrQrWrZr\r^rbrdrgrjrmrrrvr�rTrNrrrs]��2�*
�&
�PF�
	7�F�
	F�!�H���
�)�,
)�=�F�0%rNr�__main__)	rr{�unittest�test.support.script_helperr�TestCaserr��mainrTrNr�<module>r�s@���	��7�r%�(�+�+�r%�h�z���H�M�M�O�rN

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists