HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/test/__pycache__/test_rlcompleter.cpython-36.pyc
3


 \1�@sXddlZddlmZddlZddlZGdd�d�ZGdd�dej�ZedkrTej	�dS)�N)�patchc@seZdZdZdZdZdS)�
CompleteMez6 Trivial class used in testing rlcompleter.Completer. ��N)�__name__�
__module__�__qualname__�__doc__�spamZ_ham�rr�(/usr/lib64/python3.6/test_rlcompleter.pyrsrc@sZeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	j
jd
d�dd��Zdd�Z
dS)�TestRlcompletercCs2tj�|_tjttttd��|_|jjdd�dS)N)r
Zeggr�r)	�rlcompleter�	Completer�stdcompleter�dict�int�strr�	completer�complete)�selfrrr�setUp
s

zTestRlcompleter.setUpcCshGdd�dt�}Gdd�dt�}|j|jj�|j|jj�|jtj|��j�|j	t
tj|d��dS)Nc@seZdZdS)z)TestRlcompleter.test_namespace.<locals>.AN)rrrrrrr�Asrc@seZdZdS)z)TestRlcompleter.test_namespace.<locals>.BN)rrrrrrr�Bsrr)r)r�list�
assertTruerZuse_main_nsZassertFalserrrZassertRaises�	TypeError)rrrrrr�test_namespaceszTestRlcompleter.test_namespacecCs�|jt|jjd��dd�tt�D��|jt|jjd��dd�tt�D��|j|jjd�g�|j|jjd�dg�|j|jjd	�d
g�|j|jjd�dg�dS)N�dicSsg|]}|jd�r|d�qS)r�()�
startswith)�.0�xrrr�
<listcomp>$sz7TestRlcompleter.test_global_matches.<locals>.<listcomp>�stcSsg|]}|jd�r|d�qS)r%r )r!)r"r#rrrr$&sZakaksajadhakZ	CompleteMzCompleteMe(Zegzegg()�assertEqual�sortedrZglobal_matches�dir�builtinsr)rrrr�test_global_matches!sz#TestRlcompleter.test_global_matchescCs~|j|jjd�dd�tt�D��|j|jjd�g�tdd�td�D��}|j|jjd�|�|j|jjd�|�|j|jjd	�|�|j|jjd
�dg�|j|jjd�g�|j|jjd
�ddg�|j|jjd�dg�|jjd�}x|D]}|j|jd�|�q�W|j	d|�|j	d|�t
jtdtdd��>|j|jjd�dg�|j|jjd�dd�tt�D��WdQRXdS)Nzstr.scSs g|]}|jd�rdj|��qS)�szstr.{}()r!�format)r"r#rrrr$5sz5TestRlcompleter.test_attr_matches.<locals>.<listcomp>ztuple.foospameggcSs$h|]}d||dkrdndf�qS)z	None.%s%sr	r rr)r"r#rrr�	<setcomp>8sz4TestRlcompleter.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|]}|jd�rdj|��qS)r+zegg.{}()r!r,)r"r#rrrr$Ps)
r&rZattr_matchesr(rr'rrr!ZassertInr�objectr)rZexpectedZmatchesr#rrr�test_attr_matches2s2

z!TestRlcompleter.test_attr_matchescCsJGdd�d�}|�}tjt|d��}|j|jdd�d�|j|jd�dS)Nc@seZdZdZedd��ZdS)z3TestRlcompleter.test_excessive_getattr.<locals>.FoorcSs|jd7_dS)Nr)�calls)rrrr�barWsz7TestRlcompleter.test_excessive_getattr.<locals>.Foo.barN)rrrr1�propertyr2rrrr�FooUsr4)�fzf.brzf.barr)rrrr&rr1)rr4r5rrrr�test_excessive_getattrSs
z&TestRlcompleter.test_excessive_getattrcCs8Gdd�d�}tjt|�d��}|j|jdd�d�dS)Nc@seZdZdZdS)z0TestRlcompleter.test_uncreated_attr.<locals>.Foor2N)r2)rrr�	__slots__rrrrr4csr4)r5zf.rzf.bar)rrrr&r)rr4rrrr�test_uncreated_attr`sz#TestRlcompleter.test_uncreated_attrzrlcompleter._readline_availableFcCs�tj�}|j|jdd�d�|j|jdd�d�|j|jdd�d�|j|jdd	�d
�|j|jdd�d�|j|jdd�d
�|j|jdd�d�|j|jdd�d�|j|jdd�d�|j|jdd�d�dS)Nrr�	�azand rzas �asrzassert ZanZpa�passZFa�FalseZelzelif �elseZtrztry:)rrr&r)rrrrr�
test_completehszTestRlcompleter.test_completecCs�dddd�ddd�d�}tj|�}|j|jdd�d�|j|jdd��|j|jdd�d	�|j|jdd��|j|jd
d�d�|j|jd
d��|j|jdd�d�|j|jdd��|j|jd
d�d�|j|jd
d��dS)NcSsdS)Nrrrrr�<lambda>zsz8TestRlcompleter.test_duplicate_globals.<locals>.<lambda>cSsdS)Nrrrrrr@|s)r=�assert�try�
memoryview�Ellipsisr=rrrAzassert rBztry:rCrDz	Ellipsis()rrr&rZassertIsNone)r�	namespacerrrr�test_duplicate_globalsvs 
z&TestRlcompleter.test_duplicate_globalsN)rrrrrr*r0r6r8�unittestZmockrr?rFrrrrr
s	!
r
�__main__)
rGZ
unittest.mockrr)rrZTestCaser
r�mainrrrr�<module>s