
    ;e	                         d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddlm
Z
 ddlmZ dd	lmZmZ  G d
 dej                  Zd Z G d dej                  Zedk    r ej        d           dS dS )zTest , coverage 17%.    )iomenuN)requires)Tk)EditorWindow)util)Func)opendetect_encodingc                   F    e Zd Zed             Zed             Zd Zd ZdS )IOBindingTestc                     t          d           t                      | _        | j                                         t	          | j                  | _        t          j        | j                  | _        d S )Ngui)root)	r   r   r   withdrawr   editwinr   	IOBindingio)clss    4/usr/lib/python3.11/idlelib/idle_test/test_iomenu.py
setUpClasszIOBindingTest.setUpClass   sX    44"111!#+..    c                 P   | j                                          | j                                         | `| j                                         | j        j                            dd          D ]}| j                            |           | j        	                                 | `d S )Nafterinfo)
r   closer   _closer   update_idletaskstkcallafter_canceldestroy)r   ids     r   tearDownClasszIOBindingTest.tearDownClass   s    K!!###(+""7F33 	& 	&BH!!"%%%%HHHr   c                 P    |                      | j        j        | j                   d S )N)assertIsr   r   selfs    r   	test_initzIOBindingTest.test_init'   s"    dgot|44444r   c                    | j         }| j        }|j        }|j        j        }d | j        _        d}t          |          | j        _         | |            |           | j        `| j        `|                    dd            | |            d|j	        z               ||
                    dd          d            | |            d|j	        z              d S )Nz>>> if 1)resultg      ?az1.0zend-1cza
)assertEqualr   fixnewlinesr   textinterpr   get_prompt_textinserteol_conventionget)r'   eqr   fixr.   	shelltexts         r   test_fixnewlines_endz"IOBindingTest.test_fixnewlines_end*   s    Wnz #	'+9'='='=$
3355)L!=C
3355#b''(((
488E8$$e,,,
3355#b''(((((r   N)__name__
__module____qualname__classmethodr   r#   r(   r7    r   r   r   r      sf        / / [/   [5 5 5) ) ) ) )r   r   c                 X     t           fdt          j        j        D                       S )Nc              3   2   K   | ]}d  |d         v V  dS )*   Nr<   ).0filetype_tuple	extensions     r   	<genexpr>z*_extension_in_filetypes.<locals>.<genexpr>>   sG         	I>!,,     r   )anyr   r   	filetypesrC   s   `r   _extension_in_filetypesrH   =   sA        $.8     r   c                        e Zd Zd Zd Zd ZdS )FiletypesTestc                     t           j        D ]R}|                     |          5  |                     t	          |                     d d d            n# 1 swxY w Y   Sd S )NrG   )r   py_extensionssubTest
assertTruerH   )r'   rC   s     r   test_python_source_filesz&FiletypesTest.test_python_source_filesE   s    + 	 	I	22  +I66                	 	s   #AA	A	c                 J    |                      t          d                     d S )Nz.txtrN   rH   r&   s    r   test_text_fileszFiletypesTest.test_text_filesL   s#    /7788888r   c                 J    |                      t          d                     d S )N rQ   r&   s    r   test_all_fileszFiletypesTest.test_all_filesO   s#    /3344444r   N)r8   r9   r:   rO   rR   rU   r<   r   r   rJ   rJ   D   sA          9 9 95 5 5 5 5r   rJ   __main__   )	verbosity)__doc__idlelibr   unittesttest.supportr   tkinterr   idlelib.editorr   r   idlelib.idle_test.mock_idler   tokenizer	   r
   TestCaser   rH   rJ   r8   mainr<   r   r   <module>rc      s4            ! ! ! ! ! !       ' ' ' ' ' '       , , , , , ,
 + * * * * * * *() () () () ()H% () () ()V  5 5 5 5 5H% 5 5 5 zHMA r   