Your IP : 216.73.216.213
B
R�X� � @ sf d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z G dd� de
�ZdZe eej
ejg� d S )
� )�Mock)�Popen)�
TemporaryFile)�
basestring)�extend_docstringc
@ st e Zd ZdZdZdd� Zdd d
�Zddd�Zd
d� Zd dd�Z dd� Z
d!dd�Zdd� Zdd� Z
dd� Zdd� ZdS )"� MockPopenz�
A specialised mock for testing use of :class:`subprocess.Popen`.
An instance of this class can be used in place of the
:class:`subprocess.Popen` and is often inserted where it's needed using
:func:`mock.patch` or a :class:`Replacer`.
Nc C sx i | _ t� | _}| j| jj_ttd�|_|j }|j_| j|j_| j|j_| j |j _| j
|j
_| j|j_| j|j_d S )N)�spec)
�commandsr �mockr Zside_effect�Popen_instanceZreturn_value�communicate�wait�send_signal� terminate�kill�poll)�selfr
�inst� r �C/opt/alt/python37/lib/python3.7/site-packages/testfixtures/popen.py�__init__ s
zMockPopen.__init__� r �� � c C s |||||f| j |<