summaryrefslogtreecommitdiff
path: root/test_isort.py
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2015-07-12 22:59:10 -0700
committerTimothy Crosley <timothy.crosley@gmail.com>2015-07-12 22:59:10 -0700
commit8385818445e9a28d1cc6479b37dbaeddbb6b2de7 (patch)
tree6441d20e700393f2cdde2d3306ac54eb6c007011 /test_isort.py
parente6ab66575f18364841ebbcfd3ca2190d8c7cf6d7 (diff)
parent2432ca510130001cc4f5b2997724954a68112f02 (diff)
downloadisort-custom-sections.tar.gz
Merge in latest changes from developcustom-sections
Diffstat (limited to 'test_isort.py')
-rw-r--r--test_isort.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/test_isort.py b/test_isort.py
index 41458991..574f201e 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -22,7 +22,7 @@ OTHER DEALINGS IN THE SOFTWARE.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
-from pies.overrides import *
+from isort.pie_slice import *
from isort.isort import SortImports
from isort.settings import WrapModes
@@ -413,6 +413,18 @@ def test_custom_indent():
" lib20, lib21, lib22\n")
+def test_use_parentheses():
+ test_input = (
+ "from fooooooooooooooooooooooooo.baaaaaaaaaaaaaaaaaaarrrrrrr import \\"
+ " my_custom_function as my_special_function"
+ )
+ test_output = SortImports(
+ file_contents=test_input, known_third_party=['django'],
+ line_length=79, use_parentheses=True,
+ ).output
+ assert '(' in test_output
+
+
def test_skip():
"""Ensure skipping a single import will work as expected."""
test_input = ("import myproject\n"
@@ -1397,3 +1409,16 @@ def test_fcntl():
"import os\n"
"import sys\n")
assert SortImports(file_contents=test_input).output == test_input
+
+
+def test_import_split_is_word_boundary_aware():
+ """Test to ensure that isort splits words in a boundry aware mannor"""
+ test_input = ("from mycompany.model.size_value_array_import_func import ("
+ " get_size_value_array_import_func_jobs,"
+ ")")
+ test_output = SortImports(file_contents=test_input,
+ multi_line_output=WrapModes.VERTICAL_HANGING_INDENT,
+ line_length=79).output
+
+ assert test_output == ("from mycompany.model.size_value_array_import_func import \\\n"
+ " get_size_value_array_import_func_jobs\n")