관리-도구
편집 파일: replace.cpython-311.pyc
� �܋f�0 � �� � d dl Z d dlmZ d dlmZ d dlmZmZ d dlm Z m Z d dlmZ d dl mZmZmZmZmZ d dlmZmZmZmZmZ d d lmZmZ d dlZeeegef Zd � Z ed� � Z G d� d � � Z! ddedede"dedededeegef fd�Z#ededefd�� � Z$ed dededefd�� � Z%ed dededefd�� � Z& G d� de'� � Z(dZ) ee)e!j* e!j# e#e(g� � dS )!� N)�contextmanager)�partial)� get_referrers� get_referents)�setitem�getitem)� ModuleType)�Any�TypeVar�Callable�Dict�Tuple)�resolve� not_there�Resolved�classmethod_type� class_type)�wrap�extend_docstringc �D � t | |� � ot ||� � S �N)� isinstance)�x�y� descriptors �e/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/testfixtures/replace.py�not_same_descriptorr s$ � ��a��$�$�F�Z��:�-F�-F�)F�F� �Rc �� � e Zd ZdZd� Zdefd�Z ddeded e d ede ded efd�Z ddeded e d ede ded dfd�Z deded dfd�Zdede fd�Zddededed dfd�Zddededed dfd�Zdd�Zd� Zd� Zd� ZdS )�Replacerz� These are used to manage the mocking out of objects so that units of code can be tested without having to rely on their normal dependencies. c � � i | _ d S r )� originals��selfs r �__init__zReplacer.__init__ s � �:<����r �resolvedc �0 � |t u rk|j t u r, t |j |j � � n# t $ r Y nw xY w|j t u r! |j |j = d S # t $ r Y d S w xY wd S |� |j |j |� � d S r ) r �setter�setattr�delattr� container�name�AttributeErrorr �KeyError)r% r'