o
    ¯N i   ã                   @   sF   d dl mZ d dl mZ d dlmZ d dlmZ G dd„ dejƒZdS )é    )Úabsolute_import)Úprint_function)Úcontent)Úbasec                   @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )ÚTestCommandsc                 C   s*   |   d¡ |   d¡\}}}|  d|¡ dS )z‡setup.py --keywords.

        Test that the `./setup.py --keywords` command returns the correct
        value without balking.
        Úegg_infoz
--keywordsz packaging, distutils, setuptoolsN)Ú	run_setupÚassertEqual)ÚselfÚstdoutÚ_© r   úV/home/ubuntu/.local/lib/python3.10/site-packages/pbr/tests/functional/test_commands.pyÚtest_setup_py_keywords2   s   
z#TestCommands.test_setup_py_keywordsc                 C   óP   |   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.
        Úbuild_pyr   Ústderrz Running custom build_py command.r   N©r   Ú	addDetailr   Útext_contentÚassertInr	   ©r
   r   r   Úreturn_coder   r   r   Útest_custom_build_py_command<   s
   z)TestCommands.test_custom_build_py_commandc                 C   r   )z Test custom deb_version command.Údeb_versionr   r   zExtracting deb versionr   Nr   r   r   r   r   Ú"test_custom_deb_version_py_commandI   ó
   z/TestCommands.test_custom_deb_version_py_commandc                 C   r   )z Test custom rpm_version command.Úrpm_versionr   r   zExtracting rpm versionr   Nr   r   r   r   r   Ú"test_custom_rpm_version_py_commandQ   r   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.Úfreezer   Ú
z==N)Úrun_pbrr	   ÚsplitÚappendÚlowerÚsorted)r
   r   r   r   ÚpkgsÚlineÚ	pkgs_sortr   r   r   Útest_freeze_commandY   s   z TestCommands.test_freeze_commandN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r)   r   r   r   r   r   1   s    
r   N)	Ú
__future__r   r   Ú	testtoolsr   Úpbr.tests.functionalr   ÚBaseTestCaser   r   r   r   r   Ú<module>   s
   (