�
㦧b7� � � � d dl Z d dlZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZ d dl m
Z
n# e$ r d dl
Z
Y nw xY wd dlZd dl
Z
d dlZd dlZd dlmZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ ej � ej � eddd� � � � Z G d � d
ej � � Z G d� dej � � Z G d
� dej � � Z! G d� dej � � Z" G d� dej# � � Z$ G d� dej# � � Z% G d� dej# � � Z& G d� dej# � � Z' G d� dej( � � Z) G d� dej# � � Z* G d� dej# � � Z+ G d� d ej# � � Z, G d!� d"ej# � � Z- G d#� d$ej# � � Z. G d%� d&ej# � � Z/ G d'� d(ej# � � Z0 G d)� d*ej# � � Z1 G d+� d,ej# � � Z2d-� Z3dS ).� N)�mock)�matchers)� wheelfile)�git)� packaging)�basez..c �@ � � e Zd ZdZ� fd�Z� fd�Zdd�Zd� Zd� Z� xZ S ) �TestRepoz�A git repo for testing with.
Use of TempHomeDir with this fixture is strongly recommended as due to the
lack of config --local in older gits, it will write to the users global
configuration without TempHomeDir.
c �d �� t t | � � � � � || _ d S �N)�superr
�__init__�_basedir)�self�basedir� __class__s ��:/usr/lib/python3/dist-packages/pbr/tests/test_packaging.pyr zTestRepo.__init__O s* �� �
�h����&�&�(�(�(���
�
�
� c �� �� t t | � � � � � t j g d�| j � � t j � � t j g d�| j � � d S )N)r �init�.)r �addr )r
r
�setUpr �_run_cmdr �_config_git�r r s �r r zTestRepo.setUpS sj �� �
�h����#�#�%�%�%��
�*�*�*�D�M�:�:�:�������
�)�)�)�4�=�9�9�9�9�9r �test commitc �& � t t j | j � � � � }| j d|z z }t |d� � � � � t
j dd|g| j � � t
j ddd|g| j � � d S )Nz/%d�wtr r �commit�-m)�len�os�listdirr �open�closer r )r �message_content�files�paths r r zTestRepo.commitY s� � ��B�J�t�}�-�-�.�.���}�u�u�}�,���T�4����� � � ��
�u�e�T�*�D�M�:�:�:��
�u�h��o�>��
�N�N�N�N�Nr c �> |