Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_rlcompleter.cpython-35.opt-2.pyc



���]��@svddlZddlZddlZddlZGdd�d�ZGdd�dej�Zedkrrej�dS)�Nc@seZdZdZdS)�
CompleteMe�N)�__name__�
__module__�__qualname__�spam�rr�5/opt/alt/python35/lib64/python3.5/test_rlcompleter.pyrsrc@syeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zej	j
dd�d
d��Zdd�ZdS)�TestRlcompletercCsMtj�|_tjtdtdtdt��|_|jjdd�dS)NrZeggr�r)	�rlcompleter�	Completer�stdcompleter�dict�int�strr�	completer�complete)�selfrrr	�setUps
zTestRlcompleter.setUpcCs�Gdd�dt�}Gdd�dt�}|j|jj�|j|jj�|jtj|��j�|j	t
tj|d��dS)Nc@seZdZdS)z)TestRlcompleter.test_namespace.<locals>.AN)rrrrrrr	�Asrc@seZdZdS)z)TestRlcompleter.test_namespace.<locals>.BN)rrrrrrr	�Bsrr)r)r�listZ
assertTruerZuse_main_nsZassertFalserrr
Z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�dicSs)g|]}|jd�r|d�qS)r�()�
startswith)�.0�xrrr	�
<listcomp>#s	z7TestRlcompleter.test_global_matches.<locals>.<listcomp>�stcSs)g|]}|jd�r|d�qS)r!r)r)rrrrr	r %s	ZakaksajadhakZ	CompleteMzCompleteMe(Zegzegg()�assertEqual�sortedrZglobal_matches�dir�builtinsr)rrrr	�test_global_matches s

z#TestRlcompleter.test_global_matchescCs�|j|jjd�dd�tt�D��|j|jjd�g�|j|jjd�dg�|j|jjd�g�tt_|j|jjd�d	g�|j|jjd
�dd�tt�D��dS)Nzstr.scSs.g|]$}|jd�rdj|��qS)�szstr.{}()r�format)rrrrr	r 4s	z5TestRlcompleter.test_attr_matches.<locals>.<listcomp>ztuple.foospameggz
CompleteMe.spzCompleteMe.spamzCompleteme.eggzCompleteMe.me.me.spzCompleteMe.me.me.spamzegg.scSs.g|]$}|jd�rdj|��qS)r'zegg.{}()rr()rrrrr	r As	)r"rZattr_matchesr$rrr�me)rrrr	�test_attr_matches1s
	
z!TestRlcompleter.test_attr_matchescCsgGdd�d�}|�}tjtd|��}|j|jdd�d�|j|jd�dS)Nc@s(eZdZdZedd��ZdS)z3TestRlcompleter.test_excessive_getattr.<locals>.FoorcSs|jd7_dS)Nr)�calls)rrrr	�barHsz7TestRlcompleter.test_excessive_getattr.<locals>.Foo.barN)rrrr+�propertyr,rrrr	�FooFsr.�fzf.brzf.barr)rr
rr"rr+)rr.r/rrrr	�test_excessive_getattrDs
	z&TestRlcompleter.test_excessive_getattrzrlcompleter._readline_availableFcCs�tj�}|j|jdd�d�|j|jdd�d�|j|jdd�d�|j|jdd�d	�|j|jd
d�d�dS)Nrr�	�a�andr�as��assertZan)rr
r"r)rrrrr	�
test_completeQszTestRlcompleter.test_completecCsLddddddd�ddddd�i}tj|�}|j|jdd	�d�|j|jdd
��|j|jdd	�d�|j|jdd
��|j|jdd	�d�|j|jdd
��|j|jdd	�d�|j|jdd
��|j|jdd	�d�|j|jdd
��dS)N�Falser6�trycSsdS)Nrrrrr	�<lambda>^sz8TestRlcompleter.test_duplicate_globals.<locals>.<lambda>�
memoryview�EllipsiscSsdS)Nrrrrr	r:`srrz	Ellipsis()rr
r"rZassertIsNone)r�	namespacerrrr	�test_duplicate_globalsZs z&TestRlcompleter.test_duplicate_globalsN)
rrrrrr&r*r0�unittestZmockZpatchr7r>rrrr	r
s	
!	r
�__main__)	r?Z
unittest.mockr%rrZTestCaser
r�mainrrrr	�<module>sd