Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_asyncio/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_asyncio/__pycache__/test_windows_utils.cpython-312.pyc

�

(Μg����dZddlZddlZddlZejdk7rej
d��ddlZddlZddlZddlm	Z	ddl
mZd�ZGd�d	ej�ZGd
�dej�Zedk(rej"�yy)
zTests for window_utils�N�win32zWindows only)�
windows_utils)�supportc�.�tjd�y)N)�asyncio�set_event_loop_policy���A/usr/local/lib/python3.12/test/test_asyncio/test_windows_utils.py�tearDownModulers���!�!�$�'r
c��eZdZd�Zd�Zy)�	PipeTestsc��tjd��\}}	tj�}|j	|j
�|j
|jd�|j|d�|j|j
�|j
|jtj�d}	|j�td��#t$r&}|j
|j|�Yd}~nd}~wwxYwtj�}|j	|j
�|j
|jd�|j!|d�|j#|jdtjh�tj$|j&gdd�}|j
|tj(�|j	|j
�|j
|j|�|j	|j
�|j#|jdtjh�|j
|j�d�tj*|�tj*|�y#tj*|�tj*|�wxYw)	N�TT��
overlappedr�di�zexpected ERROR_IO_INCOMPLETEshelloF)r�pipe�_overlapped�
Overlapped�assertFalse�pending�assertEqual�error�ReadFile�
assertTrue�_winapi�ERROR_IO_PENDING�	getresult�RuntimeError�OSError�winerror�	WriteFile�assertIn�WaitForMultipleObjects�event�
WAIT_OBJECT_0�CloseHandle)�self�h1�h2�ov1�ERROR_IO_INCOMPLETE�e�ov2�ress        r�test_pipe_overlappedzPipeTests.test_pipe_overlappeds���#�#�|�<���B�!	$��(�(�*�C����S�[�[�)����S�Y�Y��*��L�L��S�!��O�O�C�K�K�(����S�Y�Y��(@�(@�A�"%��
C��
�
��#�#A�B�B���
B�� � ����-@�A�A��
B��
�(�(�*�C����S�[�[�)����S�Y�Y��*��M�M�"�h�'��M�M�#�)�)�a��)A�)A�%B�C��0�0�#�)�)��e�S�I�C����S�'�"7�"7�8����S�[�[�)����S�Y�Y�(;�<����S�[�[�)��M�M�#�)�)�a��)A�)A�%B�C����S�]�]�_�h�7�����#�����#��
����#�����#�s7�B$J!�C�J!�	D
�$D�J!�D
�
E,J!�!,K
c�X�tjd��\}}tj|�tj|�}|j|j
�|�|j|j|�tj�5tjddt�~tj�ddd�	tj|�td��#1swY�*xYw#t$r&}|j|j d�Yd}~yd}~wwxYw)Nrr�ignore�zexpected ERROR_INVALID_HANDLE�)rrrr(�
PipeHandler�fileno�handle�warnings�catch_warnings�filterwarnings�ResourceWarningr�
gc_collectr r!r")r)�h�_�pr.s     r�test_pipe_handlezPipeTests.test_pipe_handle=s����!�!�\�:���1����A���$�$�Q�'���������Q�'�������1�%��
$�
$�
&��#�#�H�b�?�C����� �'�	@�����"��>�?�?�'�
&���	,����Q�Z�Z��+�+��	,�s$�1C.�C:�.C7�:	D)�D$�$D)N)�__name__�
__module__�__qualname__r1rAr	r
rrrs��#$�J@r
rc��eZdZd�Zy)�
PopenTestsc�H�d}d}tjtjd|gtjtjtj��}|j
|j|jfD]"}|j|tj��$tj�}tj�}tj�}|j|j
j|�|j|jjd�|j|jjd�|j|j|jg}t!j"|dt%t&j(dz��}	|j+|	t j,�|j/|j0�|j/|j0�|j/|j0�|j+|j3�t5|��|j3�j7�}
|j3�j7�}|j9t5|
�d�|j9t5|�d�|j;|j=�j7�j?|
��|j;d	j?|��|5	ddd�y#1swYyxYw)
Nz�if 1:
            import sys
            s = sys.stdin.readline()
            sys.stdout.write(s.upper())
            sys.stderr.write('stderr')
            sblah
z-c)�stdin�stdout�stderrrTi�rsstderr) r�Popen�sys�
executable�PIPErHrIrJ�assertIsInstancer6rrr#r8rr&rr%�intr�
SHORT_TIMEOUTrr'rrr�len�rstrip�
assertGreaterr�upper�
startswith)r)�command�msgr@�f�ovin�ovout�overr�eventsr0�out�errs            r�
test_popenzPopenTests.test_popenSs3�������������w� ?�&3�&8�&8�'4�'9�'9�'4�'9�'9�
;��
�'�'�1�8�8�Q�X�X�.�A��!�!�!�]�%=�%=�>�/��%�%�'���&�&�(���&�&�(�����q�w�w�~�~�s�+�
���q�x�x����,�
���q�x�x����,��*�*�e�k�k�5�;�;�7���,�,�V�T�-0��1F�1F��1M�-N�P������g�3�3�4�������'�������'�������&�������)�3�s�8�4��o�o��&�&�(���o�o��&�&�(�����3�s�8�Q�'����3�s�8�Q�'�����	�	��*�*�,�7�7��<�=����	�,�,�S�1�2����Q�Q�s�
L�L!N)rBrCrDr`r	r
rrFrFQs��.r
rF�__main__)�__doc__rL�unittestr9�platform�SkipTestrrrr�testrr�TestCaserrFrB�mainr	r
r�<module>ris����
����<�<�7��
�(�
�
�N�
+�+����!��(�8@��!�!�8@�v0��"�"�0�f�z���H�M�M�O�r

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