[3.6] bpo-33907: Rename an IDLE module and class. (GH-7807) (GH-7809) · python/cpython@e97a685
1-"Test calltips, coverage 60%"
1+"Test calltip, coverage 60%"
223-from idlelib import calltips
3+from idlelib import calltip
44import unittest
55import textwrap
66import types
778-default_tip = calltips._default_callable_argspec
8+default_tip = calltip._default_callable_argspec
9910101111# Test Class TC is used in multiple get_argspec test methods
@@ -36,7 +36,7 @@ def sm(b): 'doc'
363637373838tc = 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
404041414242class Get_signatureTest(unittest.TestCase):
@@ -66,7 +66,7 @@ def gtest(obj, out):
6666' See help(type) for accurate signature.')
6767gtest(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.')
7171append_doc = "L.append(object) -> None -- append object to end"
7272gtest(list.append, append_doc)
@@ -100,7 +100,7 @@ def test_signature_wrap(self):
100100def test_docline_truncation(self):
101101def f(): pass
102102f.__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) + '...')
104104105105def 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
120120def f(): pass
121121f.__doc__ = 'a\n' * 15
122-self.assertEqual(signature(f), '()' + '\na' * calltips._MAX_LINES)
122+self.assertEqual(signature(f), '()' + '\na' * calltip._MAX_LINES)
123123124124def test_functions(self):
125125def t1(): 'doc'
@@ -166,15 +166,15 @@ def m2(**kwargs): pass
166166class Test:
167167def __call__(*, a): pass
168168169-mtip = calltips._invalid_method
169+mtip = calltip._invalid_method
170170self.assertEqual(signature(C().m2), mtip)
171171self.assertEqual(signature(Test()), mtip)
172172173173def 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.
176176uni = "(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)'
178178179179def test_no_docstring(self):
180180def nd(s):
@@ -207,9 +207,9 @@ def test_non_callables(self):
207207208208class Get_entityTest(unittest.TestCase):
209209def test_bad_entity(self):
210-self.assertIsNone(calltips.get_entity('1/0'))
210+self.assertIsNone(calltip.get_entity('1/0'))
211211def test_good_entity(self):
212-self.assertIs(calltips.get_entity('int'), int)
212+self.assertIs(calltip.get_entity('int'), int)
213213214214215215if __name__ == '__main__':