B ^&@sddlmZddlZddlZddlZddlZGdddZeZejZ ej Z Gdddej Z Gdddej Zed krejd d dS) )calltipNc@seZdZdZd!ddZde_ddZde_d"d d Zd e_d d Zde_ddZde_d#ddZ de _ddZ de _ddZ de _ddZ e ddZedd ZdS)$TCz (ai=None, *b)NcGsdS)N)selfaibrr6/usr/lib64/python3.7/idlelib/idle_test/test_calltip.py__init__z TC.__init__z(self, ai=None, *b)cCsdS)Nr)rrrrt1r zTC.t1z(self)cCsdS)Nr)rrrrrrt2r zTC.t2z(self, ai, b=None)cGsdS)Nr)rrargsrrrt3r zTC.t3z(self, ai, *args)cGsdS)Nr)rr rrrt4r zTC.t4z (self, *args)cOsdS)Nr)rrrr kwrrrt5r zTC.t5z(self, ai, b=None, *args, **kw)cCsdS)Nr)Znorrrrt6r zTC.t6z (no, self)cCsdS)Nr)rcirrr__call__r z TC.__call__z (self, ci)cCsdS)Nr)rrrrndr zTC.ndcCsdS)Nr)clsarrrcm szTC.cmcCsdS)Nr)rrrrsm"szTC.sm)N)N)N)__name__ __module__ __qualname__tipr r r rrrrrr classmethodr staticmethodrrrrrr s(    rc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdS) Get_argspecTestcsfdd}Gdddt}Gddd}|jdk rN||dtjd|j|tjd |tjd tjdd tjd }|tjd |||jd ||gjd||tjd||t t d}|t j d||j ddS)Ncst||dS)N) assertEqualget_spec)objout)rrrtiptest5sz.Get_argspecTest.test_builtins..tiptestc@s eZdZdS)z+Get_argspecTest.test_builtins..ListN)rrrrrrrList9sr&c@seZdZdZdS)z)Get_argspecTest.test_builtins..SBN)rrrrrrrrSB<sr'z(iterable=(), /) zY(*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.z& Append object to the end of the list.z(self, object, /)z (object, /)zmethod(function, instance)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...) list__doc__rZ_argument_positional__new__r appendtypes MethodType default_tiprecompilesub)rr%r&r'Z append_docpr)rr test_builtins3s.      zGet_argspecTest.test_builtinscCs"tjjdk r|ttjddS)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=' [...]'))textwrapZ TextWrapperr+r!r")rrrrtest_signature_wrap`s  z#Get_argspecTest.test_signature_wrapc Csddd}ddd}ddd}tj}d |d }d |d }d |d |d }xL||f||f||fgD]2\}} |j|| d|t|| WdQRXqhWdS)NdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacSsdS)Nr)srrrfoojsz3Get_argspecTest.test_properly_formated..foocSsdS)Nr)r9rrrbarmsz3Get_argspecTest.test_properly_formated..bardbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcSsdS)Nr)r9zrrrbazqsz3Get_argspecTest.test_properly_formated..bazzV(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa zaaaaaaaaaaaaaaaaaaa')z!aaaaaaaaaaaaaaaaaaa') Hello GuidozRaaaaaaaaaaaaaaaaaaa', z='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb z.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'))funcdoc)r8)r8)r8r<)rZ_INDENTsubTestr!r") rr:r;r>indentZsfooZsbarZsbazr?r@rrrtest_properly_formatedhs      z&Get_argspecTest.test_properly_formatedcCs6dd}d|_|t|ddtjdddS)NcSsdS)Nrrrrrfr z2Get_argspecTest.test_docline_truncation..fA,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz() rz...)r+r!r"rZ _MAX_COLS)rrDrrrtest_docline_truncationsz'Get_argspecTest.test_docline_truncationcCsL|ttd|ttddd}d|_|t|ddtjdS)NzFrange(stop) -> range object range(start, stop[, step]) -> range objectzbytes(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)NrrrrrrDr z3Get_argspecTest.test_multiline_docstring..fza a a a a a a a a a a a a a a z()z a)r!r"rangebytesr+rZ _MAX_LINES)rrDrrrtest_multiline_docstrings  z(Get_argspecTest.test_multiline_docstringc Csdd}d|_ddd}d|_dd}d |_d d }d |_dd d}d|_|jdk rXdnd}xF|||||tfD]2}|j|d|t||j|WdQRXqnWdS)NcSsdS)Nrrrrrr r z*Get_argspecTest.test_functions..t1z()cSsdS)Nr)rrrrrr r z*Get_argspecTest.test_functions..t2z (a, b=None)cWsdS)Nr)rr rrrrr z*Get_argspecTest.test_functions..t3z (a, *args)cWsdS)Nr)r rrrrr z*Get_argspecTest.test_functions..t4z(*args)c_sdS)Nr)rrr rrrrrr z*Get_argspecTest.test_functions..t5z(a, b=None, *args, **kw)z docr))r?)N)N)rr+rrAr!r")rr r rrrr@r?rrrtest_functionss  zGet_argspecTest.test_functionsc Cstjdk rdnd}xVtjtjtjtjtjtjtjfD]2}|j |d| t ||j |WdQRXq4W| t tj d|| t tjd|dS)Nz docr))methz(a)z(b))rr+r r rrrrrrAr!r"rrr)rr@rKrrr test_methodss &$zGet_argspecTest.test_methodsc Cstjdk rdnd}xltjdftjdftjdftjdftdftjdffD]6\}}|j||d| t |||WdQRXqFWdS) Nz docr)z()z(*args)z(self)z(ci)z(a))rKmtip) rr+tcr rrrrrAr!r")rr@rKrMrrrtest_bound_methodss z"Get_argspecTest.test_bound_methodsc CsdGddd}|}xJ|jdf|jdffD]2\}}|j||d|t||WdQRXq*WdS)Nc@seZdZddZdS)z1Get_argspecTest.test_starred_parameter..CcWsdS)Nr)r rrrm1r z4Get_argspecTest.test_starred_parameter..C.m1N)rrrrPrrrrCsrQz(*args))rKrM)rPrAr!r")rrQcrKrMrrrtest_starred_parameters z&Get_argspecTest.test_starred_parametercCsLGddd}Gddd}tj}|t|j||t||dS)Nc@seZdZddZdS)z7Get_argspecTest.test_invalid_method_get_spec..Cc[sdS)Nr)kwargsrrrm2r z:Get_argspecTest.test_invalid_method_get_spec..C.m2N)rrrrUrrrrrQsrQc@seZdZddZdS)z:Get_argspecTest.test_invalid_method_get_spec..TestcSsdS)Nr)rrrrrr zCGet_argspecTest.test_invalid_method_get_spec..Test.__call__N)rrrrrrrrTestsrV)rZ_invalid_methodr!r"rU)rrQrVrMrrrtest_invalid_method_get_specs z,Get_argspecTest.test_invalid_method_get_speccCsd}dS)Nu(AΑАאاअḀあ, a)r)rZunirrrtest_non_ascii_namesz#Get_argspecTest.test_non_ascii_namec CsPxJtjdftjdffD]2\}}|j||d|t||WdQRXqWdS)Nz(self)z())rKrM)rrrNrAr!r")rrKrMrrrtest_no_docstringsz!Get_argspecTest.test_no_docstringc CsGddd}Gddd|}Gddd|}x^|tf|tf|df|df|d ffD]2\}}|j||d |t||WdQRXqXWdS) Nc@seZdZddZdS)z8Get_argspecTest.test_buggy_getattr_class..NoCallcSstdS)N) IndexError)rnamerrr __getattr__szDGet_argspecTest.test_buggy_getattr_class..NoCall.__getattr__N)rrrr\rrrrNoCallsr]c@seZdZddZdS)z7Get_argspecTest.test_buggy_getattr_class..CallAcSsdS)Nr)rrrrrrsz@Get_argspecTest.test_buggy_getattr_class..CallA.__call__N)rrrrrrrrCallAsr^c@seZdZddZdS)z7Get_argspecTest.test_buggy_getattr_class..CallBcSsdS)Nr)ZouirrrRrrrrsz@Get_argspecTest.test_buggy_getattr_class..CallB.__call__N)rrrrrrrrCallBsr_r)z(ci)z (a, b, c))rKrM)r0rAr!r")rr]r^r_rKrMrrrtest_buggy_getattr_classsz(Get_argspecTest.test_buggy_getattr_classc CsvGdddt}Gddd|d}xN|tf|tf|dffD]2\}}|j||d|t||WdQRXq.TypeN)rrrproperty __getitem__ __setitem__ __class__rrrrTypesrec@seZdZdZdS)z4Get_argspecTest.test_metaclass_class..ObjectrdN)rrr __slots__rrrrObjectsrg) metaclassr))rKrM)typer0rAr!r")rrergrKrMrrrtest_metaclass_classs z$Get_argspecTest.test_metaclass_classc CsFx@ddddgifD],}|j|d|t|dWdQRXqWdS)Nrg00)r#r))rAr!r")rr#rrrtest_non_callablessz"Get_argspecTest.test_non_callablesN)rrrr5r7rCrFrIrJrLrOrSrWrXrYr`rjrmrrrrr +s-    r c@seZdZddZddZdS)Get_entityTestcCs|tddS)Nz1/0)Z assertIsNoner get_entity)rrrrtest_bad_entityszGet_entityTest.test_bad_entitycCs|tdtdS)Nint)ZassertIsrrorq)rrrrtest_good_entityszGet_entityTest.test_good_entityN)rrrrprrrrrrrnsrn__main__) verbosity)ZidlelibrZunittestr6r.r1rrNZ_default_callable_argspecr0Z get_argspecr"ZTestCaser rnrmainrrrrs U