diff options
| author | Timur Kushukov <timqsh@gmail.com> | 2020-10-16 21:44:27 +0500 |
|---|---|---|
| committer | Timur Kushukov <timqsh@gmail.com> | 2020-10-17 14:16:19 +0500 |
| commit | 579d93c40c736d87f5219c42222df8f02abf3abf (patch) | |
| tree | 84a84aa5e2c4e2cf23b3ae80f19c82585c57a18f /tests/unit/test_api.py | |
| parent | 6807cfbaeb7d25d2b92c4e0efce41371ffff9777 (diff) | |
| download | isort-579d93c40c736d87f5219c42222df8f02abf3abf.tar.gz | |
CLI to get imports
Diffstat (limited to 'tests/unit/test_api.py')
| -rw-r--r-- | tests/unit/test_api.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/test_api.py b/tests/unit/test_api.py index 3d257e70..fc29c33f 100644 --- a/tests/unit/test_api.py +++ b/tests/unit/test_api.py @@ -1,5 +1,6 @@ """Tests the isort API module""" import os +import sys from io import StringIO from unittest.mock import MagicMock, patch @@ -81,3 +82,9 @@ def test_diff_stream() -> None: def test_sort_code_string_mixed_newlines(): assert api.sort_code_string("import A\n\r\nimportA\n\n") == "import A\r\n\r\nimportA\r\n\n" + + +def test_get_import_file(imperfect, capsys): + api.get_imports_file(imperfect, sys.stdout) + out, _ = capsys.readouterr() + assert out == imperfect_content |
