Debian Codegraph @

vim/test/vspec/pyimport.vim

raw
1 source plugin/jedi.vim
2 source test/_utils.vim
3
4 describe 'pyimport'
5 before
6 let g:jedi#use_tabs_not_buffers = 1
7 let g:jedi#project_path = 'autoload'
8 end
9
10 after
11 try | %bwipeout! | catch | endtry
12 unlet g:jedi#project_path
13 end
14
15 it 'open_tab'
16 Pyimport os
17 Expect CurrentBufferIsModule('os') == 1
18 Pyimport subprocess
19 Expect CurrentBufferIsModule('subprocess') == 1
20 " the empty tab is sometimes also a tab
21 Expect tabpagenr('$') >= 2
22 end
23
24 it 'completion'
25 " don't know how to test this directly
26 "execute "Pyimport subproc\<Tab>"
27 "Expect CurrentBufferIsModule('subprocess') == 1
28
29 Expect jedi#py_import_completions('subproc', 0, 0) == 'subprocess'
30 Expect jedi#py_import_completions('subprocess', 0, 0) == 'subprocess'
31 let g:comp = jedi#py_import_completions('sre_', 0, 0)
32 Expect g:comp == "sre_compile\nsre_constants\nsre_parse"
33 end
34 end