]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_jedils.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / linter / test_jedils.vader
1 Before:
2   call ale#assert#SetUpLinterTest('python', 'jedils')
3   Save b:ale_python_auto_virtualenv
4
5   let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
6
7 After:
8   unlet! b:bin_dir
9   unlet! b:venv_bin
10   unlet! b:sep
11   unlet! b:executable
12
13   call ale#test#SetFilename('..')
14   call ale#assert#TearDownLinterTest()
15
16 Execute(The jedi-language-server command callback should return default string):
17   call ale#test#SetFilename('./foo.py')
18
19   AssertLinter 'jedi-language-server', ale#Escape('jedi-language-server')
20
21 Execute(The jedi-language-server executable should be configurable):
22   let g:ale_python_jedils_executable = '~/.local/bin/jedi-language-server'
23
24   AssertLinter '~/.local/bin/jedi-language-server' , ale#Escape('~/.local/bin/jedi-language-server')
25
26 Execute(virtualenv vars should be used when ale_python_auto_virtualenv = 1):
27   let b:ale_python_auto_virtualenv = 1
28   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
29
30   let b:venv_bin = ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir)
31   let b:sep = has('win32') ? ';' : ':'
32   let b:executable = ale#path#Simplify(b:venv_bin . '/jedi-language-server')
33
34   AssertLinter b:executable, ale#python#AutoVirtualenvEnvString(bufnr(''))
35   \   . ale#Escape(b:executable)
36   Assert !empty(ale#python#AutoVirtualenvEnvString(bufnr('')))
37
38 Execute(You should be able to override the jedi-language-server virtualenv lookup):
39   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
40
41   let g:ale_python_jedils_use_global = 1
42
43   AssertLinter 'jedi-language-server', ale#Escape('jedi-language-server')
44
45 Execute(Setting executable to 'pipenv' appends 'run jedi-language-server'):
46   let g:ale_python_jedils_executable = 'path/to/pipenv'
47   call ale#test#SetFilename('../test-files/dummy')
48
49   AssertLinter 'path/to/pipenv', ale#Escape('path/to/pipenv') . ' run jedi-language-server'
50
51 Execute(poetry is detected when python_jedils_auto_poetry is set):
52   let g:ale_python_jedils_auto_poetry = 1
53   call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
54
55   AssertLinter 'poetry',
56   \ ale#Escape('poetry') . ' run jedi-language-server'
57
58 Execute(uv is detected when python_jedils_auto_uv is set):
59   let g:ale_python_jedils_auto_uv = 1
60   call ale#test#SetFilename('../test-files/python/uv/whatever.py')
61
62   AssertLinter 'uv',
63   \ ale#Escape('uv') . ' run jedi-language-server'