1- "Test calltips , coverage 60%"
1+ "Test calltip , coverage 60%"
22
3- from idlelib import calltips
3+ from idlelib import calltip
44import unittest
55import textwrap
66import types
77
8- default_tip = calltips ._default_callable_argspec
8+ default_tip = calltip ._default_callable_argspec
99
1010
1111# Test Class TC is used in multiple get_argspec test methods
@@ -36,7 +36,7 @@ def sm(b): 'doc'
3636
3737
3838tc = TC ()
39- signature = calltips .get_argspec # 2.7 and 3.x use different functions
39+ signature = calltip .get_argspec # 2.7 and 3.x use different functions
4040
4141
4242class Get_signatureTest (unittest .TestCase ):
@@ -59,17 +59,17 @@ def gtest(obj, out):
5959 self .assertEqual (signature (obj ), out )
6060
6161 if List .__doc__ is not None :
62- gtest (List , '(iterable=(), /)' + calltips ._argument_positional
62+ gtest (List , '(iterable=(), /)' + calltip ._argument_positional
6363 + '\n ' + List .__doc__ )
6464 gtest (list .__new__ ,
6565 '(*args, **kwargs)\n '
6666 'Create and return a new object. '
6767 'See help(type) for accurate signature.' )
6868 gtest (list .__init__ ,
6969 '(self, /, *args, **kwargs)'
70- + calltips ._argument_positional + '\n ' +
70+ + calltip ._argument_positional + '\n ' +
7171 'Initialize self. See help(type(self)) for accurate signature.' )
72- append_doc = (calltips ._argument_positional
72+ append_doc = (calltip ._argument_positional
7373 + "\n Append object to the end of the list." )
7474 gtest (list .append , '(self, object, /)' + append_doc )
7575 gtest (List .append , '(self, object, /)' + append_doc )
@@ -102,7 +102,7 @@ def test_signature_wrap(self):
102102 def test_docline_truncation (self ):
103103 def f (): pass
104104 f .__doc__ = 'a' * 300
105- self .assertEqual (signature (f ), '()\n ' + 'a' * (calltips ._MAX_COLS - 3 ) + '...' )
105+ self .assertEqual (signature (f ), '()\n ' + 'a' * (calltip ._MAX_COLS - 3 ) + '...' )
106106
107107 def test_multiline_docstring (self ):
108108 # Test fewer lines than max.
@@ -121,7 +121,7 @@ def test_multiline_docstring(self):
121121 # Test more than max lines
122122 def f (): pass
123123 f .__doc__ = 'a\n ' * 15
124- self .assertEqual (signature (f ), '()' + '\n a' * calltips ._MAX_LINES )
124+ self .assertEqual (signature (f ), '()' + '\n a' * calltip ._MAX_LINES )
125125
126126 def test_functions (self ):
127127 def t1 (): 'doc'
@@ -168,15 +168,15 @@ def m2(**kwargs): pass
168168 class Test :
169169 def __call__ (* , a ): pass
170170
171- mtip = calltips ._invalid_method
171+ mtip = calltip ._invalid_method
172172 self .assertEqual (signature (C ().m2 ), mtip )
173173 self .assertEqual (signature (Test ()), mtip )
174174
175175 def test_non_ascii_name (self ):
176176 # test that re works to delete a first parameter name that
177177 # includes non-ascii chars, such as various forms of A.
178178 uni = "(A\u0391 \u0410 \u05d0 \u0627 \u0905 \u1e00 \u3042 , a)"
179- assert calltips ._first_param .sub ('' , uni ) == '(a)'
179+ assert calltip ._first_param .sub ('' , uni ) == '(a)'
180180
181181 def test_no_docstring (self ):
182182 def nd (s ):
@@ -209,9 +209,9 @@ def test_non_callables(self):
209209
210210class Get_entityTest (unittest .TestCase ):
211211 def test_bad_entity (self ):
212- self .assertIsNone (calltips .get_entity ('1/0' ))
212+ self .assertIsNone (calltip .get_entity ('1/0' ))
213213 def test_good_entity (self ):
214- self .assertIs (calltips .get_entity ('int' ), int )
214+ self .assertIs (calltip .get_entity ('int' ), int )
215215
216216
217217if __name__ == '__main__' :
0 commit comments