From a1f2782e4d825a54b2eec698b3520e30526a343f Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Fri, 19 Mar 2021 23:33:56 -0700 Subject: [PATCH] Create failing test for issue #1566 --- tests/unit/test_regressions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/test_regressions.py b/tests/unit/test_regressions.py index 9f1755254..4cd8a3fac 100644 --- a/tests/unit/test_regressions.py +++ b/tests/unit/test_regressions.py @@ -1607,3 +1607,15 @@ def test_isort_shouldnt_move_noqa_comment_issue_1594(): ) """ ) + + +def test_isort_correctly_handles_unix_vs_linux_newlines_issue_1566(): + IMPORT_STATEMENT = ( + "from impacket.smb3structs import (\n" + "SMB2_CREATE, SMB2_FLAGS_DFS_OPERATIONS, SMB2_IL_IMPERSONATION, " + "SMB2_OPLOCK_LEVEL_NONE, SMB2Create," + "\nSMB2Create_Response, SMB2Packet)\n" + ) + assert isort.code(IMPORT_STATEMENT, line_length=120) == isort.code( + IMPORT_STATEMENT.replace("\n", "\r\n"), line_length=120 + )