summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2015-02-05 11:33:54 -0500
committerTimothy Crosley <timothy.crosley@gmail.com>2015-02-05 11:33:54 -0500
commit6f4b5cf3f2185e7d4eb0d74549198fdb16e609d5 (patch)
treeca8609fced063209347cb89bd665926a4cdeaa63
parent24809bb5378bc1c4c5e0526a35f1d54221772cd0 (diff)
downloadisort-6f4b5cf3f2185e7d4eb0d74549198fdb16e609d5.tar.gz
Add test for top comments, thanks to @timgraham
-rw-r--r--test_isort.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py
index f25ae5fb..32cbef8b 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -1201,3 +1201,11 @@ def test_from_first():
test_input = "from os import path\nimport os\n"
assert SortImports(file_contents=test_input, from_first=True).output == test_input
+
+def test_top_comments():
+ """Ensure correct behavior with top comments"""
+ test_input = ("# -*- encoding: utf-8 -*-\n"
+ "# Test comment\n"
+ "#\n"
+ "from __future__ import unicode_literals\n")
+ assert SortImports(file_contents=test_input).output == test_input