summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2015-02-19 00:53:39 -0500
committerTimothy Crosley <timothy.crosley@gmail.com>2015-02-19 00:53:39 -0500
commit61d9854a72d8bc3ce6c9c781a486744648421812 (patch)
tree5c7bb1ee3ee006c73632a863b8f70f8c9d4915ea
parentc731b692634a5edfd5831bdba611795a3b1f9cfa (diff)
downloadisort-feature/fix-issue-250.tar.gz
Define desired behaviour when encountering jinja variables within import definitionsfeature/fix-issue-250
-rw-r--r--test_isort.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py
index a26f8cc6..506f1ab1 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -1300,3 +1300,18 @@ from foo import (
lib7
)
"""
+
+
+def test_uses_jinja_variables():
+ """Test a basic set of imports that use jinja variables"""
+ test_input = ("import { sys }\n"
+ "import { os }\n"
+ "import { myproject.test }\n"
+ "import { django.settings }")
+ test_output = SortImports(file_contents=test_input, known_third_party=['django']).output
+ assert test_output == ("import { os }\n"
+ "import { sys }\n"
+ "\n"
+ "import { django.settings }\n"
+ "\n"
+ "import { myproject.test }\n")