q5֕탛 , d Z ddlZ G d d ZdS )a This is a fork of the pymox library intended to work with Python 3. The file was modified by quermit@gmail.com and dawid.fatyga@gmail.com Previously, pyfakefs used just this file from the mox3 library. However, mox3 will soon be decommissioned, yet standard mock cannot be used because of the problem described in pyfakefs #182 and mock issue 250 (https://github.com/testing-cabal/mock/issues/250). Therefore just this file was forked from mox3 and incorporated into pyfakefs. Nc 6 e Zd ZdZd Zd Zd Zd Zd Zd Z dS ) StubOutForTestinga Sample Usage: You want os.path.exists() to always return true during testing. stubs = StubOutForTesting() stubs.Set(os.path, 'exists', lambda x: 1) ... stubs.UnsetAll() The above changes os.path.exists into a lambda that returns 1. Once the ... part of the code finishes, the UnsetAll() looks up the old value of os.path.exists and restores it. c " g | _ g | _ d S N)cachestubsselfs g/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyfakefs/mox3_stubout.py__init__zStubOutForTesting.__init__. s c V | | d S r )smart_unset_all unset_allr s r __del__zStubOutForTesting.__del__2 s* r c > t j | st j | s%||j v r|}||j v r|j | }nd}nt j | s't t j |j }n!t t j | }| d}|D ]"} |}|j | }# t $ r Y w xY w|t d | j |||f ||j |<