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 ):
@@ -66,7 +66,7 @@ def gtest(obj, out):
6666 ' See help(type) for accurate signature.' )
6767 gtest (list .__init__ ,
6868 '(self, /, *args, **kwargs)'
69- + calltips ._argument_positional + '\n ' +
69+ + calltip ._argument_positional + '\n ' +
7070 'Initialize self. See help(type(self)) for accurate signature.' )
7171 append_doc = "L.append(object) -> None -- append object to end"
7272 gtest (list .append , append_doc )
@@ -100,7 +100,7 @@ def test_signature_wrap(self):
100100 def test_docline_truncation (self ):
101101 def f (): pass
102102 f .__doc__ = 'a' * 300
103- self .assertEqual (signature (f ), '()\n ' + 'a' * (calltips ._MAX_COLS - 3 ) + '...' )
103+ self .assertEqual (signature (f ), '()\n ' + 'a' * (calltip ._MAX_COLS - 3 ) + '...' )
104104
105105 def test_multiline_docstring (self ):
106106 # Test fewer lines than max.
@@ -119,7 +119,7 @@ def test_multiline_docstring(self):
119119 # Test more than max lines
120120 def f (): pass
121121 f .__doc__ = 'a\n ' * 15
122- self .assertEqual (signature (f ), '()' + '\n a' * calltips ._MAX_LINES )
122+ self .assertEqual (signature (f ), '()' + '\n a' * calltip ._MAX_LINES )
123123
124124 def test_functions (self ):
125125 def t1 (): 'doc'
@@ -166,15 +166,15 @@ def m2(**kwargs): pass
166166 class Test :
167167 def __call__ (* , a ): pass
168168
169- mtip = calltips ._invalid_method
169+ mtip = calltip ._invalid_method
170170 self .assertEqual (signature (C ().m2 ), mtip )
171171 self .assertEqual (signature (Test ()), mtip )
172172
173173 def test_non_ascii_name (self ):
174174 # test that re works to delete a first parameter name that
175175 # includes non-ascii chars, such as various forms of A.
176176 uni = "(A\u0391 \u0410 \u05d0 \u0627 \u0905 \u1e00 \u3042 , a)"
177- assert calltips ._first_param .sub ('' , uni ) == '(a)'
177+ assert calltip ._first_param .sub ('' , uni ) == '(a)'
178178
179179 def test_no_docstring (self ):
180180 def nd (s ):
@@ -207,9 +207,9 @@ def test_non_callables(self):
207207
208208class Get_entityTest (unittest .TestCase ):
209209 def test_bad_entity (self ):
210- self .assertIsNone (calltips .get_entity ('1/0' ))
210+ self .assertIsNone (calltip .get_entity ('1/0' ))
211211 def test_good_entity (self ):
212- self .assertIs (calltips .get_entity ('int' ), int )
212+ self .assertIs (calltip .get_entity ('int' ), int )
213213
214214
215215if __name__ == '__main__' :
0 commit comments