summaryrefslogtreecommitdiff
path: root/test/fixers/test_python_add_blank_lines_fixer.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers/test_python_add_blank_lines_fixer.vader')
-rw-r--r--test/fixers/test_python_add_blank_lines_fixer.vader26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixers/test_python_add_blank_lines_fixer.vader b/test/fixers/test_python_add_blank_lines_fixer.vader
index 04ae8b45..4a91aa10 100644
--- a/test/fixers/test_python_add_blank_lines_fixer.vader
+++ b/test/fixers/test_python_add_blank_lines_fixer.vader
@@ -83,3 +83,29 @@ Expect python(Newlines should be added):
pass
else:
pass
+
+Given python(A file with a main block):
+ import os
+
+
+ def main():
+ print('hello')
+
+
+ if __name__ == '__main__':
+ main()
+
+Execute(Fix the file):
+ let g:ale_fixers = {'python': ['add_blank_lines_for_python_control_statements']}
+ ALEFix
+
+Expect python(extra newlines shouldn't be added to the main block):
+ import os
+
+
+ def main():
+ print('hello')
+
+
+ if __name__ == '__main__':
+ main()