Your IP : 18.117.231.160


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/mock_idle.cpython-36.pyc

3

� fN�@s>dZddlmZGdd�d�ZGdd�d�ZGdd�d�Zd	S)
zqMock classes that imitate idlelib modules or classes.

Attributes and methods will be added as needed for tests.
�)�Textc@s"eZdZdZddd�Zdd�ZdS)	�FuncaZRecord call, capture args, return/raise result set by test.

    When mock function is called, set or use attributes:
    self.called - increment call number even if no args, kwds passed.
    self.args - capture positional arguments.
    self.kwds - capture keyword arguments.
    self.result - return or raise value set in __init__.
    self.return_self - return self instead, to mock query class return.

    Most common use will probably be to mock instance methods.
    Given class instance, can set and delete as instance attribute.
    Mock_tk.Var and Mbox_func are special variants of this.
    NFcCs"d|_||_||_d|_d|_dS)Nr)�called�result�return_self�args�kwds)�selfrr�r
�@/opt/alt/python36/lib64/python3.6/idlelib/idle_test/mock_idle.py�__init__s
z
Func.__init__cOsB|jd7_||_||_t|jt�r.|j�n|jr8|S|jSdS)N�)rrr�
isinstancer�
BaseExceptionr)r	rrr
r
r�__call__sz
Func.__call__)NF)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rrs

rc@s"eZdZdZddd�Zdd�ZdS)�Editorz1Minimally imitate editor.EditorWindow class.
    NcCst�|_t�|_dS)N)r�text�
UndoDelegatorZundo)r	Zflist�filename�key�rootr
r
rr+szEditor.__init__cCs |jjd�}|jjd�}||fS)Nz1.0�end)r�index)r	�firstZlastr
r
r�get_selection_indices/szEditor.get_selection_indices)NNNN)rrrrrrr
r
r
rr(s
rc@s eZdZdZdd�Zdd�ZdS)rz0Minimally imitate undo.UndoDelegator class.
    cGsdS)Nr
)rr
r
r�undo_block_start9szUndoDelegator.undo_block_startcGsdS)Nr
)rr
r
r�undo_block_stop;szUndoDelegator.undo_block_stopN)rrrrrr r
r
r
rr5srN)rZidlelib.idle_test.mock_tkrrrrr
r
r
r�<module>s 

?>