Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/test/__pycache__/ |
Upload File : |
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&