diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-04-07 10:15:31 -0700 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-04-07 10:15:31 -0700 |
commit | f95d6c771f5808ef839bbec7404cb72f0f69fcc4 (patch) | |
tree | 2a013cf7970869677a3ada37d52d0e04a1d042c3 | |
parent | c46766433a36ba8a4f8f239ef57adde7cda52732 (diff) | |
download | isort-f95d6c771f5808ef839bbec7404cb72f0f69fcc4.tar.gz |
Add test case for issue #905feature/fix-issue-905
-rw-r--r-- | test_isort.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py index 7c42e84c..444b6c3b 100644 --- a/test_isort.py +++ b/test_isort.py @@ -2980,3 +2980,20 @@ def test_failing_file_check_916(): assert SortImports(file_contents=test_input, **settings).output == expected_output assert SortImports(file_contents=expected_output, **settings).output == expected_output assert not SortImports(file_contents=expected_output, check=True, **settings).incorrectly_sorted + + +def test_import_heading_issue_905(): + config = {'import_heading_stdlib': 'Standard library imports', + 'import_heading_thirdparty': 'Third party imports', + 'import_heading_firstparty': 'Local imports', + 'known_third_party': ['numpy'], + 'known_first_party': ['oklib']} + test_input = ('# Standard library imports\n' + 'import os.path as osp\n' + '\n' + '# Third party imports\n' + 'import numpy as np\n' + '\n' + '# Local imports\n' + 'from oklib.plot_ok import imagesc\n') + assert SortImports(file_contents=test_input, **config).output == test_input |