summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2015-07-14 21:16:05 -0700
committerTimothy Crosley <timothy.crosley@gmail.com>2015-07-14 21:16:05 -0700
commitfd19ed449e1660c2354f9695ae16333b85407b88 (patch)
treeff10d69471ce6bbc418f7e7fe9ed9f0436cc0378
parent48718ce5cc6303d16a642677306bf196001ed196 (diff)
downloadisort-feature/fix-issue-284.tar.gz
Add failing test to define how top of file / first comments should behave, thanks @timgraham for providing the testfeature/fix-issue-284
-rw-r--r--test_isort.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py
index 756b1932..330f957e 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -1441,3 +1441,11 @@ def test_other_file_encodings():
assert SortImports(file_path=tmp_fname).output == file_contents
finally:
shutil.rmtree(tmp_dir, ignore_errors=True)
+
+
+def test_comment_at_top_of_file():
+ test_input = ("# Comment one\n"
+ "from django import forms\n"
+ "# Comment two\n"
+ "from django.contrib.gis.geos import GEOSException\n")
+ assert SortImports(file_contents=test_input).output == test_input