.9h; \ d Z ddlZddlZddlZddlZddlmZ ddlmZ G d d Z dS )a A fake shutil module implementation that uses fake_filesystem for unit tests. Note that only `shutildisk_usage()` is faked, the rest of the functions shall work fine with the fake file system if `os`/`os.path` are patched. :Includes: FakeShutil: Uses a FakeFilesystem to provide a fake replacement for the shutil module. :Usage: The fake implementation is automatically involved if using `fake_filesystem_unittest.TestCase`, pytest fs fixture, or directly `Patcher`. N)RLock)Callablec e Zd ZdZ e Z eed oej Z eed oej Z eed oej Z ej Zg dZej dk sej dk re g d ed Zd Zd Zd Zd edefdZd Zej dk r)ej dk rdddZddej ddfdZej fdZd Z dS )FakeShutilModulezUses a FakeFilesystem to provide a fake replacement for shutil module. Automatically created if using `fake_filesystem_unittest.TestCase`, the `fs` fixture, the `patchfs` decorator, or directly the `Patcher`. _USE_CP_COPY_FILE_RANGE_HAS_FCOPYFILE_USE_CP_SENDFILE)copycopyfilermtree) win32)copy2copytreemovec dS )zqReturn the list of patched function names. Used for patching functions imported from the module. ) disk_usage r q/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyfakefs/fake_filesystem_shutil.pydirzFakeShutilModule.dir; s r c : || _ t | _ d| _ dS )zConstruct fake shutil module using the fake filesystem. Args: filesystem: FakeFilesystem used to provide file system information r N) filesystemshutil shutil_module_patch_level)selfr s r __init__zFakeShutilModule.__init__B s! %#r c , | xj dz c_ | j dk rd S | j rd| j _ | j rd| j _ | j rd| j _ | j r6t j dk r| j j | j _ d S d| j _ d S d S )N Fr )r has_fcopy_filer r use_copy_file_ranger use_sendfiler use_fd_functionssysversion_info_rmtree_unsafe_rmtree_impl_use_fd_functionsr s r _start_patching_global_varsz,FakeShutilModule._start_patching_global_varsL s Qq F 605D-# ?9>D6 827D/ =7**&5 "/// 8="444 = =r c , | xj dz c_ | j dk rd S | j rd| j _ | j rd| j _ | j rd| j _ | j r6t j dk r| j j | j _ d S d| j _ d S d S )Nr! r Tr" )r r$ r r r% r r&