summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_calltip.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/idle_test/test_calltip.py')
-rw-r--r--Lib/idlelib/idle_test/test_calltip.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py
index 0698d4f..833351b 100644
--- a/Lib/idlelib/idle_test/test_calltip.py
+++ b/Lib/idlelib/idle_test/test_calltip.py
@@ -99,6 +99,35 @@ non-overlapping occurrences o...''')
drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None,
placeholder=' [...]')''')
+ def test_properly_formated(self):
+ def foo(s='a'*100):
+ pass
+
+ def bar(s='a'*100):
+ """Hello Guido"""
+ pass
+
+ def baz(s='a'*100, z='b'*100):
+ pass
+
+ indent = calltip._INDENT
+
+ str_foo = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
+ "aaaaaaaaaa')"
+ str_bar = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
+ "aaaaaaaaaa')\nHello Guido"
+ str_baz = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
+ "aaaaaaaaaa', z='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"\
+ "bbbbbbbbbbbbbbbbb\n" + indent + "bbbbbbbbbbbbbbbbbbbbbb"\
+ "bbbbbbbbbbbbbbbbbbbbbb')"
+
+ self.assertEqual(calltip.get_argspec(foo), str_foo)
+ self.assertEqual(calltip.get_argspec(bar), str_bar)
+ self.assertEqual(calltip.get_argspec(baz), str_baz)
+
def test_docline_truncation(self):
def f(): pass
f.__doc__ = 'a'*300