Add test for isort with auto_pipenv flag(s)

This commit is contained in:
Ivor Peles 2020-10-06 04:06:44 -04:00
parent ae86d10e48
commit 6efca486e8

View file

@ -5,6 +5,7 @@ Before:
" Use an invalid global executable, so we don't match it. " Use an invalid global executable, so we don't match it.
let g:ale_python_isort_executable = 'xxxinvalid' let g:ale_python_isort_executable = 'xxxinvalid'
let g:ale_python_isort_options = '' let g:ale_python_isort_options = ''
let g:ale_python_isort_auto_pipenv = 0
call ale#test#SetDirectory('/testplugin/test/fixers') call ale#test#SetDirectory('/testplugin/test/fixers')
silent cd .. silent cd ..
@ -48,3 +49,12 @@ Execute(The isort callback should respect custom options):
\ . ' --multi-line=3 --trailing-comma -', \ . ' --multi-line=3 --trailing-comma -',
\ }, \ },
\ ale#fixers#isort#Fix(bufnr('')) \ ale#fixers#isort#Fix(bufnr(''))
Execute(Pipenv is detected when python_isort_auto_pipenv is set):
let g:ale_python_isort_auto_pipenv = 1
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
AssertEqual
\ {'command': 'cd %s:h && ' . ale#Escape('pipenv') . ' run isort -'},
\ ale#fixers#isort#Fix(bufnr(''))