Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b6e61e

Browse files
committed
Merge remote-tracking branch 'maryakins/autocomplete-params'
Conflicts:bpython/test/test_autocomplete.py
2 parents07e18d7 +4bacc37 commit5b6e61e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎bpython/test/test_autocomplete.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
fromcollectionsimportnamedtuple
2+
importinspect
3+
frombpython._py3compatimportpy3
24

35
try:
46
importunittest2asunittest
@@ -270,3 +272,19 @@ def function():
270272
self.assertEqual(self.com.matches(8,'function',
271273
locals_={'function':function}),
272274
set(('function(', )))
275+
276+
277+
classTestParameterNameCompletion(unittest.TestCase):
278+
deftest_set_of_params_returns_when_matches_found(self):
279+
deffunc(apple,apricot,banana,carrot):
280+
pass
281+
ifpy3:
282+
argspec=list(inspect.getfullargspec(func))
283+
else:
284+
argspec=list(inspect.getargspec(func))
285+
286+
argspec= ["func",argspec,False]
287+
com=autocomplete.ParameterNameCompletion()
288+
self.assertSetEqual(com.matches(1,"a",argspec=argspec),set(['apple=','apricot=']))
289+
self.assertSetEqual(com.matches(2,"ba",argspec=argspec),set(['banana=']))
290+
self.assertSetEqual(com.matches(3,"car",argspec=argspec),set(['carrot=']))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp