diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-07-05 09:25:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05 09:25:16 +0100 |
commit | d49daeb816217014a50bdab9d61b22535e55b179 (patch) | |
tree | c6b05be09ee34aa6c99dd98c404d5b369551e170 /test | |
parent | 14025c725f4d94c6661071cfa85fc5c996e8b390 (diff) | |
parent | b8591e1034abdccd3e9c960da20d5fa276fd90a0 (diff) | |
download | ale-d49daeb816217014a50bdab9d61b22535e55b179.zip |
Merge pull request #1698 from dsifford/dsifford-isort-options
add options variable to isort
Diffstat (limited to 'test')
-rw-r--r-- | test/fixers/test_isort_fixer_callback.vader | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/fixers/test_isort_fixer_callback.vader b/test/fixers/test_isort_fixer_callback.vader index 7c2b515f..56c08d26 100644 --- a/test/fixers/test_isort_fixer_callback.vader +++ b/test/fixers/test_isort_fixer_callback.vader @@ -1,5 +1,6 @@ Before: Save g:ale_python_isort_executable + Save g:ale_python_isort_options " Use an invalid global executable, so we don't match it. let g:ale_python_isort_executable = 'xxxinvalid' @@ -30,3 +31,19 @@ Execute(The isort callback should return the correct default values): \ . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -', \ }, \ ale#fixers#isort#Fix(bufnr('')) + +Execute(The isort callback should respect custom options): + let g:ale_python_isort_options = '--multi-line=3 --trailing-comma' + + AssertEqual + \ 0, + \ ale#fixers#isort#Fix(bufnr('')) + + silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') + AssertEqual + \ { + \ 'command': 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir/foo')) . ' && ' + \ . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) + \ . ' --multi-line=3 --trailing-comma -', + \ }, + \ ale#fixers#isort#Fix(bufnr('')) |