
    ;ev	                         d Z ddlmZ ddlZddlmZ ddlmZ ddlZ	ddl
Z
ddlZddlmZ ddlZddlmZ ddlmZ  G d	 d
ej                  Z G d dej                  Z G d dej                  Zedk    r ej        dd           dS dS )zTest pathbrowser, coverage 95%.    )pathbrowserN)requires)Tk)Func)browser)TreeNodec                   R    e Zd Zed             Zed             Zd Zd Zd Zd Z	dS )PathBrowserTestc                     t          d           t                      | _        | j                                         t	          j        | j        d          | _        d S )NguiT)_utest)r   r   rootwithdrawr   PathBrowserpbclss    9/usr/lib/python3.11/idlelib/idle_test/test_pathbrowser.py
setUpClasszPathBrowserTest.setUpClass   sI    44($???    c                     | j                                          | j                                         | j                                         | `| ` d S N)r   closer   update_idletasksdestroyr   s    r   tearDownClasszPathBrowserTest.tearDownClass   sF    !!###Hcfffr   c                     | j         }| j        } ||j        | j                    |t          j        i            |                     |j        t                     | 	                    t          j                   d S r   )r   assertEqualmasterr   pyclbr_modulesassertIsInstancenoder   assertIsNotNoner   	file_open)selfr   eqs      r   	test_initzPathBrowserTest.test_init"   sp    W
29di   
6?Bbgx000W./////r   c                     | j         }|                     |j                                        d           |                     |j                                        d           d S )NzPath Browser)r   r   toptitleiconnamer&   r   s     r   test_settitlezPathBrowserTest.test_settitle*   sQ    W888**N;;;;;r   c                 |    | j         }|                                }|                     |t          j                   d S r   )r   rootnoder"   r   PathBrowserTreeItem)r&   r   rns      r   test_rootnodezPathBrowserTest.test_rootnode/   s5    W[[]]b+"ABBBBBr   c                 H   | j         }t                      |j        _        t                      |j        _        |                                 |                     |j        j        j                   |                     |j        j        j                   |j        `|j        `d S r   )r   r   r*   r   r#   r   
assertTruecalledr-   s     r   
test_closezPathBrowserTest.test_close4   ss    W&&



-....///FNBGOOOr   N)
__name__
__module____qualname__classmethodr   r   r(   r.   r3   r7    r   r   r
   r
      s        @ @ [@   [0 0 0< < <
C C C
, , , , ,r   r
   c                       e Zd Zd ZdS )DirBrowserTreeItemTestc                    t          j        d          }|                                 |                     d|                                           t
          j                            t
          j                            t          j
                            d         }|                     |                    |          d           |                     |                    |dz             d           d S )N r   Tz/IconsF)r   DirBrowserTreeItem
GetSubListr   GetTextospathsplitabspathidlelib__file__ispackagedir)r&   ddirs      r   test_DirBrowserTreeItemz.DirBrowserTreeItemTest.test_DirBrowserTreeItem@   s    *2..	QYY[[)))gmmBGOOG,<==>>qA,,d333h77?????r   N)r8   r9   r:   rM   r<   r   r   r>   r>   >   s(        @ @ @ @ @r   r>   c                       e Zd Zd ZdS )PathBrowserTreeItemTestc                 ~   t          j                    }|                     |                                d           |                                }|                     t          |          t          t          j                             |                     t          |d                   t           j	                   d S )Nzsys.pathr   )
r   r1   r   rC   rB   lensysrE   typerA   )r&   psubs      r   test_PathBrowserTreeItemz0PathBrowserTreeItemTest.test_PathBrowserTreeItemM   s    +--j111llnnS3sx==111c!f{'EFFFFFr   N)r8   r9   r:   rV   r<   r   r   rO   rO   K   s(        G G G G Gr   rO   __main__   F)	verbosityexit)__doc__rH   r   unittesttest.supportr   tkinterr   os.pathrD   r    rR   idlelib.idle_test.mock_idler   r   idlelib.treer   TestCaser
   r>   rO   r8   mainr<   r   r   <module>rd      sn   ! !        ! ! ! ! ! !         



 , , , , , ,        ! ! ! ! ! !), ), ), ), ),h' ), ), ),X
@ 
@ 
@ 
@ 
@X. 
@ 
@ 
@G G G G Gh/ G G G zHMAE****** r   