← Back
Editing: test_core.cpython-311.pyc
� 㦧b� � � � d dl Z d dlZd dlZd dlZd dlZd dlmZ G d� dej � � Z G d� dej � � Z dS )� N)�basec �6 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z dS ) �TestCore)�pbr_test_cmd�pbr_test_cmd_with_classc �x � | j D ]�}d|�d| j ��}| � ||� � t j � | j |� � }t |d� � � � � }| � d|� � | � |� � \ }}}| � d|� � ��d S )NzInstalling z script to �r� pkg_resources�PBR) � cmd_names�temp_dir�assertIn�os�path�join�open�read�assertNotIn�_run_cmd) �self�install_stdout�cmd_name�install_txt�cmd_filename� script_txt�stdout�_�return_codes �5/usr/lib/python3/dist-packages/pbr/tests/test_core.py�check_script_installzTestCore.check_script_install7 s� � ��� )� )�H�H�:B�(�(�:>�-�-�I�K��M�M�+�~�6�6�6��7�<�<�� �x�@�@�L��l�C�0�0�5�5�7�7�J����_�j�9�9�9�%)�]�]�<�%@�%@�"�F�A�{��M�M�%��(�(�(�(� )� )� c �r � | � d� � | � d� � \ }}}|dk sJ �dS )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)r r r s r �test_setup_py_keywordszTestCore.test_setup_py_keywordsE sE � � ���z�"�"�"��~�~�l�3�3����1��;�;�;�;�;�;�;r! c �d � | � d� � \ }}}| � d|� � d S )N�build_sphinxr )r$ �assertEqual�r r r r s r �test_setup_py_build_sphinxz#TestCore.test_setup_py_build_sphinxP s6 � �!%����!?�!?����;�����K�(�(�(�(�(r! c �n � | � dd� � \ }}} t j t j � dd� � � � d }n# t $ r J d� � �w xY wt j |� � }d� |� � � D � � }| � d |� � d S )z.Test that the extra files are correctly added.�sdist�--formats=gztar�dist�*.tar.gzr Fzsource dist not foundc �n � g | ]2}d � |� d � � dd� � � ��3S ��/� N�r �split��.0�ps r � <listcomp>z3TestCore.test_sdist_extra_files.<locals>.<listcomp>` �7 � �C�C�C�����!�'�'�#�,�,�q�r�r�*�+�+�C�C�Cr! zextra-file.txtN) r$ �globr r r � IndexError�tarfiler �getnamesr )r r r r �tf_path�tf�namess r �test_sdist_extra_fileszTestCore.test_sdist_extra_filesT s� � � "&����9J�!K�!K����;� 2��i�����V�Z� @� @�A�A�!�D�G�G��� 2� 2� 2�1�1�1�1�1� 2���� �\�'� "� "��C�C�R�[�[�]�]�C�C�C��� � �&��.�.�.�.�.s �8A �A*c � � t j dk r| � d� � | � dd| j z � � \ }}}| � t j dd� � � � | � |� � dS )z8Test that we install a non-pkg-resources console script.�nt�Windows support is passthrough�install_scripts�--install-dir=%s� PYTHONPATH�.N) r �name�skipTestr$ r � useFixture�fixtures�EnvironmentVariabler r) s r �test_console_script_installz$TestCore.test_console_script_installd s� � � �7�d�?�?��M�M�:�;�;�;�!%����1�D�M�A�"C� "C����;� ����(��s�;�;� =� =� =� �!�!�&�)�)�)�)�)r! c �h � t j dk r| � d� � t j dk r| � d� � | � t j dd| j z � � � � | � dd| j z � � \ }}}| � |� � d S ) z8Test that we develop a non-pkg-resources console script.)� r zRFails with recent virtualenv due to https://github.com/pypa/virtualenv/issues/1638rD rE rH z.:%s�developrG N)�sys�version_inforK r rJ rL rM rN r r$ r r) s r �test_console_script_developz$TestCore.test_console_script_developr s� � � ��f�$�$��M�M�A� � � � �7�d�?�?��M�M�:�;�;�;�����(��f�t�}�4� 6� 6� 7� 7� 7� "&����)�D�M�9�";� ";����;� �!�!�&�)�)�)�)�)r! N) �__name__� __module__�__qualname__r r r% r* rB rO rU � r! r r r 3 ss � � � � � �;�I�)� )� )� <� <� <�)� )� )�/� /� /� *� *� *�*� *� *� *� *r! r c �$ � � e Zd Z� fd�Zd� Z� xZS )�TestGitSDistc �T �� t t | � � � � � | � dd� � \ }}}|r| � d� � | � dd� � \ }}}| � dd� � \ }}}| � dd� � \ }}}d S )N�git)�initzgit not installed)�addrI )�commitz-mzTurn this into a git repor, r- )�superr[ �setUpr rK r$ )r r r r � __class__s �r rb zTestGitSDist.setUp� s� �� � �l�D�!�!�'�'�)�)�)�!%���u�i�!@�!@����;�� /��M�M�-�.�.�.�!%���u�l�!C�!C����;�!%����@�"B� "B����;� "&����9J�!K�!K����;�;�;r! c � � t j t j � dd� � � � d }t j |� � }d� |� � � D � � }| � d|� � dS )z7Test that extra files found in git are correctly added.r. r/ r c �n � g | ]2}d � |� d � � dd� � � ��3S r1 r4 r6 s r r9 z;TestGitSDist.test_sdist_git_extra_files.<locals>.<listcomp>� r: r! zgit-extra-file.txtN)r; r r r r= r r>