summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2017-06-06 17:24:52 -0700
committerTimothy Crosley <timothy.crosley@gmail.com>2017-06-06 17:24:52 -0700
commit1bacfaae5c6ef5dd96dc626d7c2a7e3a52327c01 (patch)
tree6e67f23736e9263d84e1c8b354215fc9b549d056
parent2388e775c775f7d89cccb1523d4ba9edf87d24c3 (diff)
downloadisort-feature/hotfix-wrap-all-modes.tar.gz
Add failing test to illustrate issuefeature/hotfix-wrap-all-modes
-rw-r--r--test_isort.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py
index 97f54f6f..f83f4a81 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -2136,3 +2136,21 @@ def test_future_below_encoding_issue_545():
'\n'
'print("hello")\n')
assert SortImports(file_contents=test_input).output == expected_output
+
+
+def test_no_extra_lines_issue_557():
+ """Test to ensure no extra lines are prepended"""
+ test_input = ('import os\n'
+ '\n'
+ 'from scrapy.core.downloader.handlers.http import HttpDownloadHandler, HTTPDownloadHandler\n')
+ expected_output = ('import os\n'
+ 'from scrapy.core.downloader.handlers.http import HttpDownloadHandler, HTTPDownloadHandler\n')
+ assert SortImports(file_contents=test_input, force_alphabetical_sort=True,
+ force_sort_within_sections=True).output == expected_output
+
+
+def test_long_import_wrap_support_with_mode_2():
+ """Test to ensure mode 2 still allows wrapped imports with slash"""
+ test_input = ('from foobar.foobar.foobar.foobar import \\\n'
+ ' an_even_longer_function_name_over_80_characters\n')
+ assert SortImports(file_contents=test_input, multi_line_output=2, line_length=80).output == test_input