Skip to content

Commit

Permalink
Add additional test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 9, 2020
1 parent 2b57c9e commit 2120836
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ def test_correct_space_between_imports() -> None:
test_output_assign = api.sort_code_string(test_input_assign)
assert test_output_assign == "import sys\n\nVAR = 1\n"

test_input_assign = "import sys\nVAR = 1\ndef y():\n"
test_output_assign = api.sort_code_string(test_input_assign)
assert test_output_assign == "import sys\n\nVAR = 1\ndef y():\n"

test_input = """
import os
x = "hi"
def x():
pass
"""
assert isort.code(test_input) == test_input


def test_sort_on_number() -> None:
"""Ensure numbers get sorted logically (10 > 9 not the other way around)"""
Expand Down

0 comments on commit 2120836

Please sign in to comment.