← Back
Editing: test_core.cpython-38.pyc
U jP�^+ � @ sT d dl Z d dlZd dlZd dlZd dlmZ G dd� dej�ZG dd� dej�ZdS )� N)�basec @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dS )�TestCore)Zpbr_test_cmdZpbr_test_cmd_with_classc C sp | j D ]d}d|| jf }| �||� tj�| j|�}t|d��� }| �d|� | � |�\}}}| �d|� qd S )NzInstalling %s script to %s�rZ pkg_resourcesZPBR) � cmd_names�temp_dir�assertIn�os�path�join�open�readZassertNotIn�_run_cmd) �selfZinstall_stdoutZcmd_nameZinstall_txtZcmd_filenameZ script_txt�stdout�_�return_code� r �5/usr/lib/python3/dist-packages/pbr/tests/test_core.py�check_script_install6 s �zTestCore.check_script_installc C s* | � d� | � d�\}}}|dks&t�dS )z�setup.py --keywords. Test that the `./setup.py --keywords` command returns the correct value without balking. Zegg_infoz --keywordsz packaging, distutils, setuptoolsN)� run_setup�AssertionError)r r r r r r �test_setup_py_keywordsD s zTestCore.test_setup_py_keywordsc C s | � d�\}}}| �d|� d S )NZbuild_sphinxr )r ZassertEqual�r r r r r r r �test_setup_py_build_sphinxO s z#TestCore.test_setup_py_build_sphinxc C s| | � dd�\}}}zt�tj�dd��d }W n tk rN dsJtd��Y nX t�|�}dd � |� � D �}| � d |� dS )z.Test that the extra files are correctly added.�sdist�--formats=gztar�dist�*.tar.gzr Fzsource dist not foundc S s$ g | ]}d � |�d �dd� ��qS ��/� N�r �split��.0�pr r r � <listcomp>_ s z3TestCore.test_sdist_extra_files.<locals>.<listcomp>zextra-file.txtN)r �globr r r � IndexErrorr �tarfiler �getnamesr )r r r r �tf_path�tf�namesr r r �test_sdist_extra_filesS s zTestCore.test_sdist_extra_filesc C sL t jdkr| �d� | �dd| j �\}}}| �t�dd�� | �|� dS )z8Test that we install a non-pkg-resources console script.�nt�Windows support is passthroughZinstall_scripts�--install-dir=%s� PYTHONPATH�.N) r �name�skipTestr r � useFixture�fixtures�EnvironmentVariabler r r r r �test_console_script_installc s � �z$TestCore.test_console_script_installc C sR t jdkr| �d� | �t�dd| j �� | �dd| j �\}}}| �|� dS )z8Test that we develop a non-pkg-resources console script.r/ r0 r2 z.:%sZdevelopr1 N) r r4 r5 r6 r7 r8 r r r r r r r �test_console_script_developq s �� � z$TestCore.test_console_script_developN) �__name__� __module__�__qualname__r r r r r. r9 r: r r r r r 2 s r c s$ e Zd Z� fdd�Zdd� Z� ZS )�TestGitSDistc sh t t| ��� | �dd�\}}}|r.| �d� | �dd�\}}}| �dd�\}}}| �dd�\}}}d S )NZgit)Zinitzgit not installed)�addr3 )Zcommitz-mzTurn this into a git repor r )�superr>