Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/urwid/tests/__pycache__/

[FILE] test_canvas.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_container.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_decoration.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_doctests.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_escapes.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_event_loops.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_graphics.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_listbox.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_str_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_text_layout.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] test_widget.cpython-310.pyc [ edit | delete | rename ]
[FILE] util.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/urwid/tests/__pycache__/test_event_loops.cpython-310.pyc

o

��o_��@spddlZddlZddlZddlZddlmZGdd�de�ZGdd�deje�Z	zddl
ZWn	ey7YnwGdd�deje�Z
zddlZWn	eyQYnwGd	d
�d
eje�ZzddlZWn	eykYnwGdd�deje�ZzddlZWn	ey�Ynweed
�s�eed�e_Gdd�deje�ZzddlZWn
ey�YdSwGdd�deje�ZdS)�N)�PYTHON3c@s0eZdZdd�Zdd�Zdd�ZdZdd	�Zd
S)�EventLoopTestMixincsft��\��|j}g���fdd�}��fdd�}|�d|�}|��|�}|��|��ddg�dS)Ncs ��d�t��d�d��dS)N�writing�hi�ascii)�append�os�write�encode�)�out�wrr�>/usr/lib/python3/dist-packages/urwid/tests/test_event_loops.py�step1s
z1EventLoopTestMixin.test_event_loop.<locals>.step1cs��t��d��d��tj��N�r)rr�read�decode�urwid�ExitMainLoopr�r�rdrr�step2sz1EventLoopTestMixin.test_event_loop.<locals>.step2rrr)r�pipe�evl�alarm�
watch_file�run�assertEqual)�selfrrr�handler)rrr
r�test_event_loop
sz"EventLoopTestMixin.test_event_loopcs>�j���ddd������fdd�}��d|����dS)N�2cS�dS�Nrrrrr�<lambda>�z6EventLoopTestMixin.test_remove_alarm.<locals>.<lambda>c�&��������������tj�r$)�
assertTrue�remove_alarm�assertFalserrr�rr rrrr�z3EventLoopTestMixin.test_remove_alarm.<locals>.step1r)rrr)rrrr+r�test_remove_alarms
z$EventLoopTestMixin.test_remove_alarmc	sx�j�t��\}}z'��|dd������fdd�}��d|����Wt�|�t�|�dSt�|�t�|�w)NcSr#r$rrrrrr%'r&z;EventLoopTestMixin.test_remove_watch_file.<locals>.<lambda>cr'r$)r(�remove_watch_filer*rrrr+rrr(r,z8EventLoopTestMixin.test_remove_watch_file.<locals>.step1r)rrrrrr�close)r�fd_r�fd_wrrr+r�test_remove_watch_file#s


�z)EventLoopTestMixin.test_remove_watch_file�c
s0|j}g�t��\}}|�t�|d�d��d��fdd�}�fdd�}�fdd	�}d
d�}|�d|�}|�d
|�}|�|�}	|jdurJ|�|	d�|�	�|�
d�v��|�
d�v��|�||�}�dd�=|�	�|��dg�|�
|�|��|�d|�}|�
t|j	�|�||�}|�
t|j	�dS)N�datar�c���d�dS�N�hello�rr�rrr�	say_hello9�z.EventLoopTestMixin.test_run.<locals>.say_hellocr6�N�waitingr9rr:rr�say_waiting;r<z0EventLoopTestMixin.test_run.<locals>.say_waitingc���d�tj��N�
clean exit�rrrrr:rr�
exit_clean=�
z/EventLoopTestMixin.test_run.<locals>.exit_cleancS�dddS�Nr3rrrrrr�
exit_error@�z/EventLoopTestMixin.test_run.<locals>.exit_errorg{�G�z�?g{�G�zt?r3r8rBr)rrrrr	r
r�
enter_idle�_expected_idle_handlerr(rr.�assertRaises�ZeroDivisionError)
rrrr
r;r?rDrHr �idle_handlerr:r�test_run4s2


zEventLoopTestMixin.test_runN)�__name__�
__module__�__qualname__r!r-r2rKrOrrrrr	s
rc@�eZdZdd�ZdS)�SelectEventLoopTestcC�t��|_dSr$)r�SelectEventLoopr�rrrr�setUpVr<zSelectEventLoopTest.setUpN�rPrQrRrXrrrrrTU�rTc@seZdZdd�Zdd�ZdS)�GLibEventLoopTestcCrUr$)r�
GLibEventLooprrWrrrrX`r<zGLibEventLoopTest.setUpcC�(|j}|�ddd��|�t|j�dS)N��?cS�ddSrGrrrrrr%e�z.GLibEventLoopTest.test_error.<locals>.<lambda>�rrrLrMr�rrrrr�
test_errorc�zGLibEventLoopTest.test_errorN)rPrQrRrXrcrrrrr[_sr[c@rS)�TornadoEventLoopTestcCsddlm}t�|��|_dS)Nr)�IOLoop)�tornado.iolooprfr�TornadoEventLoopr)rrfrrrrXoszTornadoEventLoopTest.setUpNrYrrrrrenrZrec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TwistedEventLoopTestcCrUr$)r�TwistedEventLooprrWrrrrXzr<zTwistedEventLoopTest.setUpcCr#r$rrWrrrr!~�z$TwistedEventLoopTest.test_event_loopcCr#r$rrWrrrr-�rkz&TwistedEventLoopTest.test_remove_alarmcCr#r$rrWrrrr2�rkz+TwistedEventLoopTest.test_remove_watch_filec
s4�j�g�t��\�}��t�|d�d��d���fdd�}�fdd�}�fdd	�}���fd
d�}���fdd
�}�fdd�}dd�}���|�}	��d|�}	��d|�}	��d|�}	��d|�}	����|�d���	���
d�v����
d�v����
d�v����
d�v����
d�v��dS)Nr4rr5cs��t��d��d��dSr)rrrrrrrrr�sz,TwistedEventLoopTest.test_run.<locals>.step2cr6r7r9rr:rrr;�r<z0TwistedEventLoopTest.test_run.<locals>.say_hellocr6r=r9rr:rrr?�r<z2TwistedEventLoopTest.test_run.<locals>.say_waitingcs>��ddd��}����|������|����d�dS)Nr"cSr#r$rrrrrr%�r&zJTwistedEventLoopTest.test_run.<locals>.test_remove_alarm.<locals>.<lambda>�remove_alarm ok)rr(r)r*r)r �rrrrrr-�sz8TwistedEventLoopTest.test_run.<locals>.test_remove_alarmc	szt��\}}z$��|dd��}����|������|��Wt�|�t�|�nt�|�t�|�w��d�dS)NcSr#r$rrrrrr%�r&zOTwistedEventLoopTest.test_run.<locals>.test_remove_watch_file.<locals>.<lambda>zremove_watch_file ok)rrrr(r.r*r/r)r0r1r rmrrr2�s

�z=TwistedEventLoopTest.test_run.<locals>.test_remove_watch_filecr@rArCrr:rrrD�rEz1TwistedEventLoopTest.test_run.<locals>.exit_cleancSrFrGrrrrrrH�rIz1TwistedEventLoopTest.test_run.<locals>.exit_errorg�������?g�������?g���Q��?g�Q���?r3�da�tar8rlrB)rrrrr	r
rrrJrr()
rr
rr;r?r-r2rDrHr r)rrrrrrO�s.
zTwistedEventLoopTest.test_runcCr])Nr^cSr_rGrrrrrr%�r`z1TwistedEventLoopTest.test_error.<locals>.<lambda>rarbrrrrc�rdzTwistedEventLoopTest.test_errorN)	rPrQrRrXr!r-r2rOrcrrrrriys,ri�
ensure_future�asyncc@s(eZdZdd�ZdZdd�Zdd�ZdS)�AsyncioEventLoopTestcCrUr$)r�AsyncioEventLooprrWrrrrX�r<zAsyncioEventLoopTest.setUpNcCr])Nr^cSr_rGrrrrrr%�r`z1AsyncioEventLoopTest.test_error.<locals>.<lambda>rarbrrrrc�rdzAsyncioEventLoopTest.test_errorcCs2|j}tjdd��}t�|��|�t|j�dS)Ncss�dd}|VdSrGr)�resultrrr�
error_coro�s�
z=AsyncioEventLoopTest.test_coroutine_error.<locals>.error_coro)r�asyncio�	coroutinerprLrMr)rrrurrr�test_coroutine_error�s

z)AsyncioEventLoopTest.test_coroutine_error)rPrQrRrXrKrcrxrrrrrr�s
rrc@s eZdZdd�ZdZdd�ZdS)�TrioEventLoopTestcCrUr$)r�
TrioEventLooprrWrrrrX�r<zTrioEventLoopTest.setUpNcCr])Nr^cSr_rGrrrrrr%�r`z.TrioEventLoopTest.test_error.<locals>.<lambda>rarbrrrrc�rdzTrioEventLoopTest.test_error)rPrQrRrXrKrcrrrrry�sry)r�unittest�platformr�urwid.compatr�objectr�TestCaserT�
gi.repository�gi�ImportErrorr[�tornadore�twistedrirv�hasattr�getattrrprr�trioryrrrr�<module>sNL�
��?�
�
Upload File: