File: pyimport.vim

package info (click to toggle)
python-jedi 0.10.0~git1%2Bf05c071-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,064 kB
  • ctags: 3,014
  • sloc: python: 16,997; makefile: 149; ansic: 13
file content (32 lines) | stat: -rw-r--r-- 848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
source plugin/jedi.vim
source test/utils.vim

describe 'pyimport'
    before
        let g:jedi#use_tabs_not_buffers = 1
    end

    after
        bd!
        bd!
    end

    it 'open_tab'
        Pyimport os 
        Expect CurrentBufferIsModule('os') == 1
        Pyimport subprocess 
        Expect CurrentBufferIsModule('subprocess') == 1
        " the empty tab is sometimes also a tab
        Expect tabpagenr('$') >= 2
    end

    it 'completion'
        " don't know how to test this directly
        "execute "Pyimport subproc\<Tab>"
        "Expect CurrentBufferIsModule('subprocess') == 1

        Expect jedi#py_import_completions('subproc', 0, 0) == 'subprocess'
        Expect jedi#py_import_completions('subprocess', 0, 0) == 'subprocess'
        Expect jedi#py_import_completions('zip', 0, 0) == "zipfile\nzipimport"
    end
end