
    ϶vg                         d 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
Z
 G d de          Ze
j        d	             Z G d
 d          ZdS )zTests for distutils.cmd.    N)debug)Command)Distribution)DistutilsOptionErrorc                       e Zd Zd ZdS )MyCmdc                     d S N )selfs    a/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/_distutils/tests/test_cmd.pyinitialize_optionszMyCmd.initialize_options   s        N)__name__
__module____qualname__r   r   r   r   r   r      s#            r   r   c                 8    t          t                                S r
   )r   r   )requests    r   cmdr      s       r   c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	TestCommandc                    g d|_         g d|_        t                      |_        d|_        |                    d           |                    d           t          j        t                    5  |                    d           d d d            n# 1 swxY w Y   t          j        t                    5  |                    d           d d d            n# 1 swxY w Y   d|_	        |                    d	           |j	        dd
gk    sJ ddg|_
        |                    d           ddg|_        t          j        t                    5  |                    d           d d d            d S # 1 swxY w Y   d S )N)one   three)r   twor   okyes_string_listyes_string_list2not_string_listnot_string_list2zok,dokoption1dokxxxwwwoption2r   option3)r    r   objectr!   r   ensure_string_listpytestraisesr   r"   r&   r'   r   r   s     r   test_ensure_string_listz#TestCommand.test_ensure_string_list   s;   111555%xx#01111222]/00 	6 	6""#4555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 ]/00 	7 	7""#5666	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 y))){tUm++++eny)))Qi]/00 	. 	.""9---	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	.s6   0BBB6CCCE11E58E5c                     t          j        t                    5  |                    dddd           d d d            n# 1 swxY w Y   d }d|_        ||_        |                    dddd           d S )	NT funcr   )infilesoutfiler0   argsc                     |dk    sJ d S )Nzgenerating out from inr   )r0   r3   exec_msglevels       r   _executez,TestCommand.test_make_file.<locals>._execute6   s    7777777r   inout)r*   r+   	TypeError	make_fileforceexecute)r   r   r7   s      r   test_make_filezTestCommand.test_make_file0   s    ]9%% 	J 	JMM$bMIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J	8 	8 	8 	dERHHHHHs   A  AAc                     g fd}||_         d|_        d|_        ddg|_        |                                 g d}|k    sJ d S )Nc                 2                         |            d S r
   )append)msgr6   msgss     r   	_announcez0TestCommand.test_dump_options.<locals>._announce@   s    KKr      )r"   r/   r/   )r&   r/   r/   )zcommand options for 'MyCmd':z  option1 = 1z  option2 = 1)announcer"   r&   user_optionsdump_options)r   r   rD   wantedrC   s       @r   test_dump_optionszTestCommand.test_dump_options=   st    	 	 	 	 	 !/1DESSSv~~~~~~r   c                 8   d|_         |                    d           d |_        |                    dd           t          |d          sJ d|_        t          j        t                    5  |                    d           d d d            d S # 1 swxY w Y   d S )Nr   r"   r&   r$   rE   r'   )r"   ensure_stringr&   hasattrr'   r*   r+   r   r,   s     r   test_ensure_stringzTestCommand.test_ensure_stringL   s    )$$$)U+++sI&&&&&]/00 	) 	)i(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)s   ,BBBc                     t           |_        |                    d           d|_        t	          j        t                    5  |                    d           d d d            d S # 1 swxY w Y   d S Nr"   r$   r&   )__file__r"   ensure_filenamer&   r*   r+   r   r,   s     r   test_ensure_filenamez TestCommand.test_ensure_filenameX   s    I&&&]/00 	+ 	+	***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+s   A%%A),A)c                 6   t           j                            t                    pt           j        |_        |                    d           d|_        t          j	        t                    5  |                    d           d d d            d S # 1 swxY w Y   d S rP   )ospathdirnamerQ   curdirr"   ensure_dirnamer&   r*   r+   r   r,   s     r   test_ensure_dirnamezTestCommand.test_ensure_dirname_   s    gooh//<299%%%]/00 	* 	*y)))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s   +BBBc                    |                     d           |                                j        dk    sJ |                    t          dd           |                     d           |                                j        dk    sJ d S )Nr$   r/   DEBUGTzxxx
)debug_print
readouterrr9   setattrr   )r   r   capsysmonkeypatchs       r   test_debug_printzTestCommand.test_debug_printf   s      ""&",,,,E7D111  ""&'111111r   N)
r   r   r   r-   r>   rJ   rN   rS   rZ   rb   r   r   r   r   r      s        . . .2I I I  
) 
) 
)+ + +* * *2 2 2 2 2r   r   )__doc__rU   	distutilsr   distutils.cmdr   distutils.distr   distutils.errorsr   r*   r   fixturer   r   r   r   r   <module>ri      s      				       ! ! ! ! ! ! ' ' ' ' ' ' 1 1 1 1 1 1     G   
 ! ! !U2 U2 U2 U2 U2 U2 U2 U2 U2 U2r   