File: //usr/lib/python3/dist-packages/twisted/test/__pycache__/test_monkey.cpython-310.pyc
o
�b� � @ s@ d Z ddlmZ ddlmZ G dd� d�ZG dd� dej�ZdS ) z%
Tests for L{twisted.python.monkey}.
� )�
MonkeyPatcher)�unittestc @ s e Zd Zdd� ZdS )�TestObjc C s d| _ d| _d| _d S )Nz foo valuez bar valuez baz value)�foo�bar�baz��self� r
�:/usr/lib/python3/dist-packages/twisted/test/test_monkey.py�__init__ s
zTestObj.__init__N)�__name__�
__module__�__qualname__r r
r
r
r r
s r c @ sh e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� Zdd� Zdd� Z
dd� ZdS )�MonkeyPatcherTestsz;
Tests for L{MonkeyPatcher} monkey-patching class.
c C s t � | _t � | _t� | _d S �N)r �
testObject�originalObjectr �
monkeyPatcherr r
r
r �setUp s zMonkeyPatcherTests.setUpc C sJ | j �� | �| jj| jj� | �| jj| jj� | �| jj| jj� dS )zL
A monkey patcher without patches shouldn't change a thing.
N)r �patch�assertEqualr r r r r r r
r
r �
test_empty s
zMonkeyPatcherTests.test_emptyc C sZ t | jddf| jddf�}|�� | �d| jj� | �d| jj� | �| jj| jj� dS )z}
Constructing a L{MonkeyPatcher} with patches should add all of the
given patches to the patch list.
r �hahar �heheN)r r r r r r r r )r �patcherr
r
r �test_constructWithPatches* s �z,MonkeyPatcherTests.test_constructWithPatchesc C s0 | j �| jdd� | j �� | �| jjd� dS )zf
Patching an attribute that exists sets it to the value defined in the
patch.
r r N)r �addPatchr r r r r r
r
r �test_patchExisting7 s
z%MonkeyPatcherTests.test_patchExistingc C s&