/ test / fixers / test_break_up_long_lines_python_fixer.vader
test_break_up_long_lines_python_fixer.vader
 1  Before:
 2    call ale#test#SetDirectory('/testplugin/test/fixers')
 3  
 4  After:
 5    call ale#test#RestoreDirectory()
 6  
 7  Execute(Long lines with basic function calls should be broken up correctly):
 8    AssertEqual
 9    \ [
10    \   'def foo():',
11    \   '    some_variable = this_is_a_longer_function(',
12    \   'first_argument,',
13    \   ' second_argument,',
14    \   ' third_with_function_call(',
15    \   'foo,',
16    \   ' bar,',
17    \   '))',
18    \ ],
19    \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [
20    \   'def foo():',
21    \   '    some_variable = this_is_a_longer_function(first_argument, second_argument, third_with_function_call(foo, bar))',
22    \ ])
23  
24  Execute(Longer lines should be permitted if a configuration file allows it):
25    call ale#test#SetFilename('../test-files/long-line/foo/bar.py')
26  
27    AssertEqual
28    \ [
29    \   'x = this_line_is_between_79_and_90_characters(first, second, third, fourth, fifth)',
30    \   'y = this_line_is_longer_than_90_characters(',
31    \   'much_longer_word,',
32    \   ' another_longer_word,',
33    \   ' a_third_long_word,',
34    \   ')'
35    \ ],
36    \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [
37    \   'x = this_line_is_between_79_and_90_characters(first, second, third, fourth, fifth)',
38    \   'y = this_line_is_longer_than_90_characters(much_longer_word, another_longer_word, a_third_long_word)',
39    \ ])