U
    jPŒ^h  ã                   @   s.   d dl mZ d dlmZ G dd„ dejƒZdS )é    )Úcontent)Úbasec                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚTestCommandsc                 C   sP   |   d¡\}}}|  dt |¡¡ |  dt |¡¡ |  d|¡ |  d|¡ dS )zÃTest custom build_py command.

        Test that a custom subclass of the build_py command runs when listed in
        the commands [global] option, rather than the normal build command.
        Zbuild_pyÚstdoutÚstderrz Running custom build_py command.r   N©Z	run_setupZ	addDetailr   Ztext_contentZassertInÚassertEqual©Úselfr   r   Úreturn_code© r   ú9/usr/lib/python3/dist-packages/pbr/tests/test_commands.pyÚtest_custom_build_py_command/   s
    z)TestCommands.test_custom_build_py_commandc                 C   sP   |   d¡\}}}|  dt |¡¡ |  dt |¡¡ |  d|¡ |  d|¡ dS )z Test custom deb_version command.Zdeb_versionr   r   zExtracting deb versionr   Nr   r	   r   r   r   Ú"test_custom_deb_version_py_command<   s
    z/TestCommands.test_custom_deb_version_py_commandc                 C   sP   |   d¡\}}}|  dt |¡¡ |  dt |¡¡ |  d|¡ |  d|¡ dS )z Test custom rpm_version command.Zrpm_versionr   r   zExtracting rpm versionr   Nr   r	   r   r   r   Ú"test_custom_rpm_version_py_commandD   s
    z/TestCommands.test_custom_rpm_version_py_commandc                 C   sh   |   d¡\}}}|  d|¡ g }| d¡D ]}| | d¡d  ¡ ¡ q*t|dd… ƒ}|  ||¡ dS )z?Test that freeze output is sorted in a case-insensitive manner.Zfreezer   Ú
z==N)Zrun_pbrr   ÚsplitÚappendÚlowerÚsorted)r
   r   r   r   ZpkgsÚlZ	pkgs_sortr   r   r   Útest_freeze_commandL   s    z TestCommands.test_freeze_commandN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r   .   s   r   N)Z	testtoolsr   Z	pbr.testsr   ZBaseTestCaser   r   r   r   r   Ú<module>)   s   