Your IP : 18.117.151.127


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__/test_calltip.cpython-36.pyc

3

� fi�@s�dZddlmZddlZddlZddlZejZGdd�d�Ze�Z	ej
ZGdd�dej�Z
Gdd	�d	ej�Zed
kr�ejdd�dS)
zTest calltip, coverage 60%�)�calltipNc@s�eZdZdZdZd dd�Zde_dd�Zd	e_d!d
d�Zde_d
d�Zde_dd�Z	de	_d"dd�Z
de
_dd�Zde_dd�Zde_e
dd��Zedd��ZdS)#�TC�docz
(ai=None, *b)NcGsdS)rN�)�self�ai�brr�C/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_calltip.py�__init__szTC.__init__z(self, ai=None, *b)cCsdS)rNr)rrrr	�t1szTC.t1z(self)cCsdS)rNr)rrrrrr	�t2szTC.t2z(self, ai, b=None)cGsdS)rNr)rr�argsrrr	�t3szTC.t3z(self, ai, *args)cGsdS)rNr)rr
rrr	�t4szTC.t4z
(self, *args)cOsdS)rNr)rrrr
�kwrrr	�t5szTC.t5z(self, ai, b=None, *args, **kw)cCsdS)rNr)�norrrr	�t6szTC.t6z
(no, self)cCsdS)rNr)r�cirrr	�__call__szTC.__call__z
(self, ci)cCsdS)rNr)�cls�arrr	�cm szTC.cmcCsdS)rNr)rrrr	�sm"szTC.sm)N)N)N)�__name__�
__module__�__qualname__�__doc__�tipr
rrrrrrr�classmethodr�staticmethodrrrrr	rs(


rc@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�Get_signatureTestcs�Gdd�dt�}Gdd�d�}�fdd�}|jdk	r@|||j�|tjd�|tjdtjd	d
�d}|tj|�|gj|�||j|�|tjd�||�t	�d
dl
}|jd�}||jd�||jd�dS)Nc@seZdZdZdS)z-Get_signatureTest.test_builtins.<locals>.Listz
List() docN)rrrrrrrr	�List5sr"c@seZdZdZdS)z+Get_signatureTest.test_builtins.<locals>.SBN)rrrrrrrr	�SB8sr#cs�jt|�|�dS)N)�assertEqual�	signature)�obj�out)rrr	�gtest:sz.Get_signatureTest.test_builtins.<locals>.gtestzY(*args, **kwargs)
Create and return a new object.  See help(type) for accurate signature.z(self, /, *args, **kwargs)�
z>Initialize self.  See help(type(self)) for accurate signature.z0L.append(object) -> None -- append object to endzmethod(function, instance)r�aO(pattern, repl, string, count=0, flags=0)
Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
replacement repl.  repl can be either a string or a callable;
if a string, backslash escapes in it are processed.  If it is
a callable, it's passed the match object and must returnzm(repl, string, count=0)
Return the string obtained by replacing the leftmost non-overlapping occurrences o...)
�listr�__new__r
rZ_argument_positional�append�types�
MethodType�default_tip�re�compile�sub)rr"r#r(Z
append_docr1�pr)rr	�
test_builtins2s,

zGet_signatureTest.test_builtinscCs"tjjdk	r|jttj�d�dS)Nz�(width=70, initial_indent='', subsequent_indent='', expand_tabs=True,
    replace_whitespace=True, fix_sentence_endings=False, break_long_words=True,
    drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None,
    placeholder=' [...]'))�textwrapZTextWrapperrr$r%)rrrr	�test_signature_wrap\sz%Get_signatureTest.test_signature_wrapcCs8dd�}dd|_|jt|�ddtjdd�dS)NcSsdS)Nrrrrr	�fesz4Get_signatureTest.test_docline_truncation.<locals>.fri,z()
�z...)rr$r%rZ	_MAX_COLS)rr8rrr	�test_docline_truncationds
z)Get_signatureTest.test_docline_truncationcCsP|jtt�d�|jtt�d�dd�}dd|_|jt|�ddtj�dS)	NzFrange(stop) -> range object
range(start, stop[, step]) -> range objectz�bytes(iterable_of_ints) -> bytes
bytes(string, encoding[, errors]) -> bytes
bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
bytes(int) -> bytes object of size given by the parameter initialized with null bytes
bytes() -> empty bytes objectcSsdS)Nrrrrr	r8xsz5Get_signatureTest.test_multiline_docstring.<locals>.fza
�z()z
a)r$r%�range�bytesrrZ
_MAX_LINES)rr8rrr	�test_multiline_docstringis


z*Get_signatureTest.test_multiline_docstringcCs�dd�}d|_ddd�}d|_dd�}d	|_d
d�}d|_dd
d�}d|_|jdk	rXdnd}x.|||||tfD]}|jt|�|j|�qnWdS)NcSsdS)rNrrrrr	r}sz,Get_signatureTest.test_functions.<locals>.t1z()cSsdS)rNr)rrrrr	rsz,Get_signatureTest.test_functions.<locals>.t2z(a, b=None)cWsdS)rNr)rr
rrr	r�sz,Get_signatureTest.test_functions.<locals>.t3z
(a, *args)cWsdS)rNr)r
rrr	r�sz,Get_signatureTest.test_functions.<locals>.t4z(*args)c_sdS)rNr)rrr
rrrr	r�sz,Get_signatureTest.test_functions.<locals>.t5z(a, b=None, *args, **kw)z
docr*)N)N)rrrr$r%)rrrrrrr�funcrrr	�test_functions|s

z Get_signatureTest.test_functionscCs�tjdk	rdnd}x>tjtjtjtjtjtjtjfD]}|j	t
|�|j|�q4W|j	t
tj�d|�|j	t
tj
�d|�dS)Nz
docr*z(a)z(b))rrrrrrrrrr$r%rrr)rr�methrrr	�test_methods�s
&zGet_signatureTest.test_methodscCsjtjdk	rdnd}xRtjdftjdftjdftjdftdftjdffD]\}}|jt	|�||�qFWdS)Nz
docr*z()z(*args)z(self)z(ci)z(a))
rr�tcrrrrrr$r%)rrrA�mtiprrr	�test_bound_methods�s
z$Get_signatureTest.test_bound_methodscCsJGdd�d�}|�}x0|jdf|jdffD]\}}|jt|�|�q*WdS)Nc@seZdZdd�ZdS)z3Get_signatureTest.test_starred_parameter.<locals>.CcWsdS)Nr)r
rrr	�m1�sz6Get_signatureTest.test_starred_parameter.<locals>.C.m1N)rrrrFrrrr	�C�srGz(*args))rFr$r%)rrG�crArDrrr	�test_starred_parameter�sz(Get_signatureTest.test_starred_parametercCsLGdd�d�}Gdd�d�}tj}|jt|�j�|�|jt|��|�dS)Nc@seZdZdd�ZdS)z:Get_signatureTest.test_invalid_method_signature.<locals>.Cc[sdS)Nr)�kwargsrrr	�m2�sz=Get_signatureTest.test_invalid_method_signature.<locals>.C.m2N)rrrrKrrrr	rG�srGc@seZdZdd�ZdS)z=Get_signatureTest.test_invalid_method_signature.<locals>.TestcSsdS)Nr)rrrr	r�szFGet_signatureTest.test_invalid_method_signature.<locals>.Test.__call__N)rrrrrrrr	�Test�srL)rZ_invalid_methodr$r%rK)rrGrLrDrrr	�test_invalid_method_signature�s
z/Get_signatureTest.test_invalid_method_signaturecCsd}tjjd|�dkst�dS)Nu(AΑАאاअḀあ, a)r*z(a))rZ_first_paramr3�AssertionError)rZunirrr	�test_non_ascii_name�sz%Get_signatureTest.test_non_ascii_namecCsFdd�}|t_|jt|�d�|jttj�d�|jttj�d�dS)NcSsdS)Nr)�srrr	�nd�sz/Get_signatureTest.test_no_docstring.<locals>.ndz(s)z())rrQr$r%rC)rrQrrr	�test_no_docstring�s
z#Get_signatureTest.test_no_docstringcCsxGdd�d�}Gdd�d|�}Gdd�d|�}xD|tf|tf|�df|�df|�d	ffD]\}}|jt|�|�qXWdS)
Nc@seZdZdd�ZdS)z:Get_signatureTest.test_attribute_exception.<locals>.NoCallcSst�dS)N)�
BaseException)r�namerrr	�__getattr__�szFGet_signatureTest.test_attribute_exception.<locals>.NoCall.__getattr__N)rrrrUrrrr	�NoCall�srVc@seZdZdd�ZdS)z9Get_signatureTest.test_attribute_exception.<locals>.CallAcSsdS)Nr)ZouirrrHrrr	r�szBGet_signatureTest.test_attribute_exception.<locals>.CallA.__call__N)rrrrrrrr	�CallA�srWc@seZdZdd�ZdS)z9Get_signatureTest.test_attribute_exception.<locals>.CallBcSsdS)Nr)rrrrr	r�szBGet_signatureTest.test_attribute_exception.<locals>.CallB.__call__N)rrrrrrrr	�CallB�srXr*z	(a, b, c)z(ci))r0r$r%)rrVrWrXrArDrrr	�test_attribute_exception�sz*Get_signatureTest.test_attribute_exceptioncCs.x(ddddgifD]}|jt|�d�qWdS)Nrg�0�0r*)r$r%)rr&rrr	�test_non_callables�sz$Get_signatureTest.test_non_callablesN)rrrr5r7r:r>r@rBrErIrMrOrRrYr\rrrr	r!*s*
r!c@seZdZdd�Zdd�ZdS)�Get_entityTestcCs|jtjd��dS)Nz1/0)ZassertIsNoner�
get_entity)rrrr	�test_bad_entity�szGet_entityTest.test_bad_entitycCs|jtjd�t�dS)N�int)ZassertIsrr^r`)rrrr	�test_good_entity�szGet_entityTest.test_good_entityN)rrrr_rarrrr	r]�sr]�__main__�)�	verbosity)rZidlelibrZunittestr6r.Z_default_callable_argspecr0rrCZget_argspecr%ZTestCaser!r]r�mainrrrr	�<module>s'

?>