HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-311.opt-2.pyc
�

��Vc�����	ddlmZddlmZed��ddlZddlZddlmZm	Z	m
Z
mZmZddl
mZddlmZddlmZd	�Zd
�ZGd�dej��ZGd
�dej��ZGd�dej��ZGd�dej��ZGd�dej��ZGd�dej��ZGd�dej��Zedkrejd���dSdS)�)�textview)�requires�guiN)�Tk�TclError�CHAR�NONE�WORD)�Button)�Func)�	Mbox_funcc�T�t��at���dS�N�r�root�withdraw���3D:\Python311\Lib\idlelib\idle_test\test_textview.py�setUpModulers��
�4�4�D��M�M�O�O�O�O�Orc�l�t���t���bdSr�r�update_idletasks�destroyrrr�tearDownModulers(���������L�L�N�N�N���rc�J�eZdZe��Ze��Ze��ZdS)�VWN)�__name__�
__module__�__qualname__r�	transient�grab_set�wait_windowrrrrr#s/����������I��t�v�v�H��$�&�&�K�K�Krrc�&�eZdZd�Zd�Zd�Zd�ZdS)�ViewWindowTestc��tj���tj���tj���dSr)rr!�__init__r"r#��selfs r�setUpzViewWindowTest.setUp,sD��
�������
�������
����!�!�!�!�!rc�2�ttdd��}|�tjj��|�tjj��|�tjj��|���dS)N�Title�	test text)rr�
assertTruer!�calledr"r#�ok�r)�views  r�test_init_modalzViewWindowTest.test_init_modal1si���$���-�-�������+�,�,�,������*�+�+�+������-�.�.�.����	�	�	�	�	rc�6�ttddd���}|�tjj��|�tjj��|�tjj��|���dS�Nr,r-F��modal)rr�assertFalser!r/r"r#r0r1s  r�test_init_nonmodalz!ViewWindowTest.test_init_nonmodal8st���$���E�:�:�:�������,�-�-�-������+�,�,�,������.�/�/�/����	�	�	�	�	rc���ttddd���}t��|_|���|�|jj��|`|���dSr5)rrrrr0r.r/r1s  r�test_okzViewWindowTest.test_ok?s]���$���E�:�:�:���v�v������	�	�	������+�,�,�,��L��������rN)rrr r*r3r9r;rrrr%r%*sP������"�"�"�
����������rr%c��eZdZd�ZdS)�AutoHideScrollbarTestc��tjt��}|�t|j��|�t|j��dSr)�tv�AutoHideScrollbarr�assertRaisesr�pack�place)r)�scrolls  r�test_forbidden_geometryz-AutoHideScrollbarTest.test_forbidden_geometryJsH���%�d�+�+�����(�F�K�0�0�0����(�F�L�1�1�1�1�1rN)rrr rErrrr=r=Hs#������2�2�2�2�2rr=c�P�eZdZed���Zed���Zefd�Zd�Zd�Z	dS)�ScrollableTextFrameTestc�X�t��x|_}|���dSrr��clsrs  r�
setUpClassz"ScrollableTextFrameTest.setUpClassRs#���$�$����4��
�
�����rc�n�|j���|j���|`dSrr�rJs r�
tearDownClassz%ScrollableTextFrameTest.tearDownClassWs3����!�!�#�#�#���������H�H�Hrc�n��tj|jfd|i|����fd�}|�|���S)N�wrapc�X����������dSr)rr)�frames�r�
cleanup_framez9ScrollableTextFrameTest.make_frame.<locals>.cleanup_frame_s&����"�"�$�$�$��M�M�O�O�O�O�Or)r?�ScrollableTextFramer�
addCleanup)r)rP�kwargsrSrRs    @r�
make_framez"ScrollableTextFrameTest.make_frame]sT����&�t�y�F�F�t�F�v�F�F��	�	�	�	�	�	
���
�&�&�&��rc���|���}|j�dd��|�|j�dd��d��dS)N�1.0r-�1.end)rW�text�insert�assertEqual�get)r)rRs  r�
test_line1z"ScrollableTextFrameTest.test_line1esU�����!�!��
�
���%��-�-�-���������w�7�7��E�E�E�E�Erc��|�t���}|�|j�d��t��|�|j��ttfD]�}|�	|���5|�|���}|�|j�d��|��|�
|j��ddd��n#1swxYwY��dS)N)rPrP)rWr	r]r[�cget�assertIsNotNone�xscrollrr
�subTest�assertIsNone)r)rRrPs   r�test_horiz_scrollbarz,ScrollableTextFrameTest.test_horiz_scrollbarjs'�����T��*�*����������0�0�$�7�7�7����U�]�+�+�+��4�L�	1�	1�D����4��(�(�
1�
1����T��2�2��� � ������!8�!8�$�?�?�?��!�!�%�-�0�0�0�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1��	1�	1s�AC:�:C>	�C>	N)
rrr �classmethodrKrNr	rWr_rfrrrrGrGPs�����������[������[��
#�����F�F�F�
1�1�1�1�1rrGc�@�eZdZed���Zed���Zd�ZdS)�
ViewFrameTestc��t��x|_}|���tj|d��|_dS)Nr-)rrrr?�	ViewFramerRrIs  rrKzViewFrameTest.setUpClass~s6���$�$����4��
�
�����L��{�3�3��	�	�	rc�r�|`|j���|j���|`dSr)rRrrrrMs rrNzViewFrameTest.tearDownClass�s8���I���!�!�#�#�#���������H�H�Hrc�h�|jjj}|�|dd��d��dS)NrYrZr-)rRr[r^r])r)r^s  rr_zViewFrameTest.test_line1�s6���j�o�!�������U�G�,�,�k�:�:�:�:�:rN)rrr rgrKrNr_rrrriri|sW�������4�4��[�4�
����[��;�;�;�;�;rric�X�eZdZed���Zed���Zd�Zd�Zd�Zd�Z	d�Z
dS)	�ViewFunctionTestc�X�tj|_t��t_dSr)r?�	showerror�
orig_errorr
rMs rrKzViewFunctionTest.setUpClass�s������ �{�{����rc�,�|jt_|`dSr)rrr?rqrMs rrNzViewFunctionTest.tearDownClass�s���~����N�N�Nrc��tjtddd���}|�|tj��|�|jtj��|j���dSr5)r?�	view_textr�assertIsInstance�
ViewWindow�	viewframerkr0r1s  r�test_view_textzViewFunctionTest.test_view_text�sf���|�D�'�;�e�D�D�D�����d�B�M�2�2�2����d�n�b�l�;�;�;���������rc�j�tjtdtdd���}|�|tj��|�|jtj��|jjj	j
}|�d|dd����|���dS)Nr,�asciiFr6�TestrYrZ)
r?�	view_filer�__file__rvrwrxrk�	textframer[r^�assertInr0)r)r2r^s   r�test_view_filezViewFunctionTest.test_view_file�s����|�D�'�8�W�E�J�J�J�����d�B�M�2�2�2����d�n�b�l�;�;�;��n�&�+�/���
�
�f�c�c�%��1�1�2�2�2����	�	�	�	�	rc��tjtdddd���}|�|��|�tjjd��dS)Nr,zabc.xyzr{Fr6zFile Load Error)r?r}rrer]rq�titler1s  r�
test_bad_filezViewFunctionTest.test_bad_file�sR���|�D�'�9�g�U�K�K�K�����$���������+�->�?�?�?�?�?rc�R�tj}|�|�|�t
��dd����}t
jtd|dd���}|�	|��|�
tjjd��dS)Nz..zCREDITS.txtr,r{Fr6zUnicode Decode Error)
�os�path�abspath�join�dirnamer~r?r}rrer]rqr�)r)�p�fnr2s    r�test_bad_encodingz"ViewFunctionTest.test_bad_encoding�s����G��
�Y�Y�q�v�v�a�i�i��1�1�4��G�G�
H�
H���|�D�'�2�w�e�D�D�D�����$���������+�-C�D�D�D�D�Drc��tjtdddd���}|jjj}|�|�d��d��dS)Nr,�testF�none)r7rPrP)r?rurrxrr[r]ra)r)r2�text_widgets   r�test_nowrapzViewFunctionTest.test_nowrap�sS���|�D�'�6��V�L�L�L���n�.�3������)�)�&�1�1�6�:�:�:�:�:rN)rrr rgrKrNryr�r�r�r�rrrroro�s��������#�#��[�#�����[��������@�@�@�E�E�E�;�;�;�;�;rroc�&�eZdZd�Zd�Zd�Zd�ZdS)�ButtonClickTestc�"�d|_d|_dS)NF)r2r/r(s rr*zButtonClickTest.setUp�s����	�����rc�J�|jr|j���dSdSr)r2rr(s r�tearDownzButtonClickTest.tearDown�s0���9�	 ��I��������	 �	 rc����fd�}ttd|���}|�����|j�����jd�����j���d�����jj	j
j�dd��d��dS)	Nc�Z��d�_tjtddd����_dS)NT�
TITLE_TEXT�COMMAND)�_utest)r/r?rurr2r(s�r�_commandzAButtonClickTest.test_view_text_bind_with_button.<locals>._command�s(����D�K���T�<��4�P�P�P�D�I�I�Ir�BUTTON�r[�commandTr�rYrZr�)
rr�invokerUrr]r/r2r�rxrr[r^)r)r��buttons`  r�test_view_text_bind_with_buttonz/ButtonClickTest.test_view_text_bind_with_button�s����	Q�	Q�	Q�	Q�	Q���8�X�>�>�>���
�
���������'�'�'������d�+�+�+��������*�*�L�9�9�9������,�6�;�?�?��w�O�O�"�	$�	$�	$�	$�	$rc�����fd�}ttd|���}|�����|j�����jd�����j���d���jj	j
jj}tt��5}��|dd��|��������|�����|dd	��|��������ddd��dS#1swxYwYdS)
Nc�f��d�_tjtdtdd����_dS)NT�
TITLE_FILEr{)�encodingr�)r/r?r}rr~r2r(s�rr�zAButtonClickTest.test_view_file_bind_with_button.<locals>._command�s4����D�K���T�<��.5�d�D�D�D�D�I�I�Irr�r�Tr�rYrZz3.0z3.end)rrr�rUrr]r/r2r�rxrr[r^�openr~�readline�strip)r)r�r�r^�fs`    r�test_view_file_bind_with_buttonz/ButtonClickTest.test_view_file_bind_with_button�s����	D�	D�	D�	D�	D���8�X�>�>�>���
�
���������'�'�'������d�+�+�+��������*�*�L�9�9�9��i�!�+�0�4��
�(�^�^�	H�q����S�S���0�0�!�*�*�,�,�2D�2D�2F�2F�G�G�G�
�J�J�L�L�L����S�S���0�0�!�*�*�,�,�2D�2D�2F�2F�G�G�G�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H����	H�	H�	H�	H�	H�	Hs�BE-�-E1�4E1N)rrr r*r�r�r�rrrr�r��sU��������� � � �$�$�$�H�H�H�H�Hrr��__main__�)�	verbosity) �idlelibrr?�test.supportrr��unittest�tkinterrrrr	r
�tkinter.ttkr�idlelib.idle_test.mock_idler�idlelib.idle_test.mock_tkr
rrrwr�TestCaser%r=rGriror�r�mainrrr�<module>r�sF���#�"�"�"�"�"�!�!�!�!�!�!�������	�	�	�	�����2�2�2�2�2�2�2�2�2�2�2�2�2�2�������,�,�,�,�,�,�/�/�/�/�/�/����

�
�
����������������X�&����<2�2�2�2�2�H�-�2�2�2�)1�)1�)1�)1�)1�h�/�)1�)1�)1�X;�;�;�;�;�H�%�;�;�;�**;�*;�*;�*;�*;�x�(�*;�*;�*;�\&H�&H�&H�&H�&H�h�'�&H�&H�&H�R�z����H�M�A��������r