
    z%i	                         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       yy)zTest , coverage 17%.    )iomenuN)requires)Tk)EditorWindow)util)Func)opendetect_encodingc                   8    e Zd Zed        Zed        Zd Zd Zy)IOBindingTestc                     t        d       t               | _        | j                  j                          t	        | j                        | _        t        j                  | j
                        | _        y )Ngui)root)	r   r   r   withdrawr   editwinr   	IOBindingio)clss    Q/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/idlelib/idle_test/test_iomenu.py
setUpClasszIOBindingTest.setUpClass   sH    4"1!!#++.    c                 h   | j                   j                          | j                  j                          | `| j                  j                          | j                  j                  j                  dd      D ]  }| j                  j                  |        | j                  j                          | `y )Nafterinfo)
r   closer   _closer   update_idletaskstkcallafter_canceldestroy)r   ids     r   tearDownClasszIOBindingTest.tearDownClass   s    K!!#((++""7F3 	&BHH!!"%	&Hr   c                 d    | j                  | j                  j                  | j                         y )N)assertIsr   r   selfs    r   	test_initzIOBindingTest.test_init'   s    dggoot||4r   c                    | j                   }| j                  }|j                  }|j                  j                  }d | j                  _        d}t        |      | j                  _         | |       |       | j                  `| j                  `|j                  dd        | |       d|j                  z           ||j                  dd      d        | |       d|j                  z          y )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    WWnnzz #	'+9'=$
35)LL!=C
35#b'''(
488E8$e,
35#b'''(r   N)__name__
__module____qualname__classmethodr   r#   r(   r7    r   r   r   r      s2    / /  5)r   r   c                 \     t         fdt        j                  j                  D              S )Nc              3   2   K   | ]  }d  |d   v   yw)*   Nr<   ).0filetype_tuple	extensions     r   	<genexpr>z*_extension_in_filetypes.<locals>.<genexpr>>   s)       I;>!,,s   )anyr   r   	filetypesrC   s   `r   _extension_in_filetypesrH   =   s)     $..88  r   c                       e Zd Zd Zd Zd Zy)FiletypesTestc                     t         j                  D ]7  }| j                  |      5  | j                  t	        |             d d d        9 y # 1 sw Y   DxY w)NrG   )r   py_extensionssubTest
assertTruerH   )r'   rC   s     r   test_python_source_filesz&FiletypesTest.test_python_source_filesE   sS    ++ 	I	2 +I6 	 s   AA	c                 8    | j                  t        d             y )Nz.txtrN   rH   r&   s    r   test_text_fileszFiletypesTest.test_text_filesL   s    /78r   c                 8    | j                  t        d             y )N rQ   r&   s    r   test_all_fileszFiletypesTest.test_all_filesO   s    /34r   N)r8   r9   r:   rO   rR   rU   r<   r   r   rJ   rJ   D   s    9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      si       !  '  ,
 +()H%% ()V5H%% 5 zHMMA r   