Debian Codegraph @

test/test_cache.py

raw symbols SCIP
1 """
2 Test all things related to the ``jedi.cache`` module.
3 """
4
5
6 def test_cache_get_signatures(Script):
7 """
8 See github issue #390.
9 """
10 def check(column, call_name, path=None):
11 assert Script(s, path=path).get_signatures(1, column)[0].name == call_name
12
13 s = 'str(int())'
14
15 for i in range(3):
16 check(8, 'int')
17 check(4, 'str')
18 # Can keep doing these calls and always get the right result.
19
20 # Now lets specify a source_path of boo and alternate these calls, it
21 # should still work.
22 for i in range(3):
23 check(8, 'int', 'boo')
24 check(4, 'str', 'boo')
25
26
27 def test_cache_line_split_issues(Script):
28 """Should still work even if there's a newline."""
29 assert Script('int(\n').get_signatures()[0].name == 'int'