From fd19ed449e1660c2354f9695ae16333b85407b88 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 14 Jul 2015 21:16:05 -0700 Subject: Add failing test to define how top of file / first comments should behave, thanks @timgraham for providing the test --- test_isort.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.1