403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.23.128.245
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/__pycache__/mox3_stubout.cpython-311.pyc
�

��bg��,�dZddlZGd�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�eZdZdZd�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|_dS�N)�cache�stubs��selfs �f/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pyfakefs/mox3_stubout.py�__init__zStubOutForTesting.__init__.s����
���
�
�
�c�V�|���|���dSr)�smart_unset_all�	unset_allr	s r�__del__zStubOutForTesting.__del__2s*���������������r
c��tj|��stj|��s||jvr|}t	||��}n�tj|��s'ttj|j����}n!ttj|����}|���d}|D]%}	|}t	||��}�#t$rY�"wxYw|�td���|j�
|��}|�$t|t��rt|��}|j
�|||f��t|||��dS)a�Replace obj.attr_name with new_attr.

        This method is smart and works at the module, class, and instance level
        while preserving proper inheritance. It will not stub out C types
        however unless that has been explicitly allowed by the type.

        This method supports the case where attr_name is a staticmethod or a
        classmethod of obj.

        Notes:
          - If obj is an instance, then it is its class that will actually be
            stubbed. Note that the method Set() does not do that: if obj is
            an instance, it (and not its class) will be stubbed.
          - The stubbing is using the builtin getattr and setattr. So, the
            __get__ and __set__ will be called when stubbing (TODO: A better
            idea would probably be to manipulate obj.__dict__ instead of
            getattr() and setattr()).

        Raises AttributeError if the attribute cannot be found.
        NzAttribute not found.)�inspect�ismodule�isclass�__dict__�getattr�list�getmro�	__class__�reverse�AttributeError�get�
isinstance�staticmethodr�append�setattr)	r
�obj�	attr_name�new_attr�orig_obj�	orig_attr�mro�cls�
old_attributes	         r�	smart_setzStubOutForTesting.smart_set6ss��*��C� � �	����$�$�	�)2�c�l�)B�)B��H���Y�/�/�I�I��?�3�'�'�
0��7�>�#�-�8�8�9�9����7�>�#�.�.�/�/���K�K�M�M�M��I��
�
���"�H� '��Y� 7� 7�I�I��%�����H������� �!7�8�8�8���(�(��3�3�
��$��M�<�)P�)P�$�$�Y�/�/�I��
���8�Y�	�:�;�;�;���)�X�.�.�.�.�.s�<C�
C�Cc�l�|j���|jD]}t|��g|_dS)z�Reverses all the SmartSet() calls.

        Restores things to their original definition. Its okay to call
        SmartUnsetAll() repeatedly, as later calls have no effect if no
        SmartSet() calls have been made.
        N)rrr!)r
�argss  rrz!StubOutForTesting.smart_unset_allns?��	
�
�������J�	�	�D��T�N�N�N���
�
�
r
c�V�t||��}|j�|��}|�Nt|t��rt	|��}n)t|t
��rt|j��}|j�|||f��t|||��dS)aReplace child_name's old definition with new_child.

        Replace definition in the context of the given parent. The parent could
        be a module when the child is a function at module scope. Or the parent
        could be a class when a class' method is being replaced. The named
        child is set to new_child, while the prior definition is saved away
        for later, when unset_all() is called.

        This method supports the case where child_name is a staticmethod or a
        classmethod of parent.
        N)
rrrrr�classmethod�__func__rr r!)r
�parent�
child_name�	new_child�	old_childr)s      r�setzStubOutForTesting.set|s����F�J�/�/�	���+�+�J�7�7�
��$��-��6�6�
<�(��3�3�	�	��M�;�7�7�
<�'�	�(:�;�;�	��
���6�9�j�9�:�:�:���
�I�.�.�.�.�.r
c��|j���|jD]\}}}t|||���g|_dS)z�Reverses all the Set() calls.

        Restores things to their original definition. Its okay to call
        unset_all() repeatedly, as later calls have no effect if no Set()
        calls have been made.
        N)rrr!)r
r0r3r1s    rrzStubOutForTesting.unset_all�sP��	
�
������-1�Z�	3�	3�)�F�I�z��F�J�	�2�2�2�2���
�
�
r
N)
�__name__�
__module__�__qualname__�__doc__rrr*rr4r�r
rrrsy������
�
�������6/�6/�6/�p���/�/�/�0����r
r)r9rrr:r
r�<module>r;sV��
�
�����D�D�D�D�D�D�D�D�D�Dr

Youez - 2016 - github.com/yon3zu
LinuXploit