Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_rlcompleter.cpython-39.opt-1.pyc

a

��gd�@sXddlZddlmZddlZddlZGdd�d�ZGdd�dej�ZedkrTe�	�dS)�N)�patchc@seZdZdZdZdZdS)�
CompleteMez6 Trivial class used in testing rlcompleter.Completer. ��N)�__name__�
__module__�__qualname__�__doc__�spamZ_ham�rr�1/usr/local/lib/python3.9/test/test_rlcompleter.pyrsrc@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
j�dd�dd��Z
dd�ZdS)�TestRlcompletercCs2t��|_t�ttttd��|_|j�dd�dS)N)r
Zeggr�r)	�rlcompleter�	Completer�stdcompleter�dict�int�strr�	completer�complete��selfrrr�setUp
s
�
zTestRlcompleter.setUpcCshGdd�dt�}Gdd�dt�}|�|jj�|�|jj�|�t�|��j�|�	t
tj|d��dS)Nc@seZdZdS)z)TestRlcompleter.test_namespace.<locals>.AN�rrrrrrr�Asrc@seZdZdS)z)TestRlcompleter.test_namespace.<locals>.BNrrrrr�Bsr)r)r�list�
assertTruerZuse_main_ns�assertFalserrrZassertRaises�	TypeError)rrrrrr�test_namespaceszTestRlcompleter.test_namespacecCs�|�t|j�d��dd�tt�D��|�t|j�d��dd�tt�D��|�|j�d�g�|�|j�d�dg�|�|j�d	�d
g�|�|j�d�dg�dS)N�dicSsg|]}|�d�r|d�qS)r"�(��
startswith��.0�xrrr�
<listcomp>$�z7TestRlcompleter.test_global_matches.<locals>.<listcomp>�stcSsg|]}|�d�r|d�qS)r+r#r$r&rrrr)&r*ZakaksajadhakZ	CompleteMzCompleteMe(Zegzegg()�assertEqual�sortedrZglobal_matches�dir�builtinsrrrrr�test_global_matches!s �����z#TestRlcompleter.test_global_matchescCs�|�|j�d�dd�tt�D��|�|j�d�g�tdd�td�D��}|�|j�d�|�|�|j�d�|�|�|j�d	�|�|�|j�d
�dg�|�|j�d�g�|�|j�d
�ddg�|�|j�d�dg�|j�d�}|D]}|�|�d�|�q�|�	d|�|�	d|�t
jtdtdd��H|�|j�d�dg�|�|j�d�dd�tt�D��Wd�n1�s�0YdS)Nzstr.scSs g|]}|�d�rd�|��qS)�szstr.{}(�r%�formatr&rrrr)5s
�z5TestRlcompleter.test_attr_matches.<locals>.<listcomp>ztuple.foospameggcSs$h|]}d||dkrdndf�qS)z	None.%s%sr	r#rrr&rrr�	<setcomp>8s�z4TestRlcompleter.test_attr_matches.<locals>.<setcomp>zNone.zNone._zNone.__z
CompleteMe.spzCompleteMe.spamzCompleteme.eggzCompleteMe.zCompleteMe.mro(zCompleteMe._zCompleteMe._hamz
CompleteMe.__zCompleteMe.__name__zCompleteMe.__new__(�meT)ZcreatezCompleteMe.me.me.spzCompleteMe.me.me.spamzegg.scSs g|]}|�d�rd�|��qS)r1zegg.{}(r2r&rrrr)Ps
�)
r,rZattr_matchesr.rr-rrr%ZassertInr�objectr)rZexpected�matchesr(rrr�test_attr_matches2s@�������z!TestRlcompleter.test_attr_matchescCsJGdd�d�}|�}t�t|d��}|�|�dd�d�|�|jd�dS)	z;Ensure getattr() is invoked no more than once per attributecs$eZdZdZdZ�fdd�Z�ZS)z3TestRlcompleter.test_excessive_getattr.<locals>.Foorrcs&|dkr|jd7_dSt��|�S)N�barr)�calls�super�__getattribute__)r�name��	__class__rrr<]szDTestRlcompleter.test_excessive_getattr.<locals>.Foo.__getattribute__)rrrr:r9r<�
__classcell__rrr>r�FooZsrA��f�f.br�f.barrN)rrrr,rr:�rrArCrrrr�test_excessive_getattrSs
	z&TestRlcompleter.test_excessive_getattrcCsHGdd�d�}|�}t�t|d��}|�|�dd�d�|�|j�dS)Nc@s eZdZdZdZedd��ZdS)z<TestRlcompleter.test_property_method_not_called.<locals>.FoorFcSsd|_|jS)NT)�property_called�_barrrrrr9msz@TestRlcompleter.test_property_method_not_called.<locals>.Foo.barN)rrrrIrH�propertyr9rrrrrAisrArBrDrrE)rrrr,rrrHrFrrr�test_property_method_not_calledhs
	z/TestRlcompleter.test_property_method_not_calledcCs8Gdd�d�}t�t|�d��}|�|�dd�d�dS)Nc@seZdZdZdS)z0TestRlcompleter.test_uncreated_attr.<locals>.Foo)r9N)rrr�	__slots__rrrrrA{srArBzf.rrE)rrrr,r)rrArrrr�test_uncreated_attrxsz#TestRlcompleter.test_uncreated_attrzrlcompleter._readline_availableFcCs�t��}|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�dd	�d
�|�|�dd�d�|�|�dd�d
�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�dS)Nrr�	�azand rzas �asr�assert Zan�pa�passZFa�False�elzelif �else�tr�try:)rrr,r)rrrrr�
test_complete�szTestRlcompleter.test_completecCs�dddd�ddd�d�}t�|�}|�|�dd�d�|�|�dd��|�|�dd�d	�|�|�dd��|�|�d
d�d�|�|�d
d��|�|�dd�d�|�|�dd��|�|�d
d�d�|�|�d
d��dS)NcSsdS�Nrrrrr�<lambda>�r*z8TestRlcompleter.test_duplicate_globals.<locals>.<lambda>cSsdSrZrrrrrr[�r*)rT�assert�try�
memoryview�EllipsisrTrrr\rQr]rXr^r_z	Ellipsis()rrr,rZassertIsNone)r�	namespacerrrr�test_duplicate_globals�s"�
z&TestRlcompleter.test_duplicate_globalsN)rrrrr!r0r8rGrKrM�unittestZmockrrYrarrrrr
s	!

r
�__main__)
rbZ
unittest.mockrr/rrZTestCaser
r�mainrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists