bpo-33907: Rename an IDLE module and class. (GH-7807) · python/cpython@06e2029
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):
@@ -59,17 +59,17 @@ def gtest(obj, out):
5959self.assertEqual(signature(obj), out)
60606161if List.__doc__ is not None:
62-gtest(List, '(iterable=(), /)' + calltips._argument_positional
62+gtest(List, '(iterable=(), /)' + calltip._argument_positional
6363+ '\n' + List.__doc__)
6464gtest(list.__new__,
6565'(*args, **kwargs)\n'
6666'Create and return a new object. '
6767'See help(type) for accurate signature.')
6868gtest(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+ "\nAppend object to the end of the list.")
7474gtest(list.append, '(self, object, /)' + append_doc)
7575gtest(List.append, '(self, object, /)' + append_doc)
@@ -102,7 +102,7 @@ def test_signature_wrap(self):
102102def test_docline_truncation(self):
103103def f(): pass
104104f.__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) + '...')
106106107107def 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
122122def f(): pass
123123f.__doc__ = 'a\n' * 15
124-self.assertEqual(signature(f), '()' + '\na' * calltips._MAX_LINES)
124+self.assertEqual(signature(f), '()' + '\na' * calltip._MAX_LINES)
125125126126def test_functions(self):
127127def t1(): 'doc'
@@ -168,15 +168,15 @@ def m2(**kwargs): pass
168168class Test:
169169def __call__(*, a): pass
170170171-mtip = calltips._invalid_method
171+mtip = calltip._invalid_method
172172self.assertEqual(signature(C().m2), mtip)
173173self.assertEqual(signature(Test()), mtip)
174174175175def 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.
178178uni = "(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)'
180180181181def test_no_docstring(self):
182182def nd(s):
@@ -209,9 +209,9 @@ def test_non_callables(self):
209209210210class Get_entityTest(unittest.TestCase):
211211def test_bad_entity(self):
212-self.assertIsNone(calltips.get_entity('1/0'))
212+self.assertIsNone(calltip.get_entity('1/0'))
213213def test_good_entity(self):
214-self.assertIs(calltips.get_entity('int'), int)
214+self.assertIs(calltip.get_entity('int'), int)
215215216216217217if __name__ == '__main__':