| 1 |
from functools import partial |
| 2 |
|
| 3 |
from ..utils import isort_test |
| 4 |
|
| 5 |
pycharm_isort_test = partial(isort_test, profile="pycharm") |
| 6 |
|
| 7 |
|
| 8 |
def test_pycharm_snippet_one() -> None: |
| 9 |
pycharm_isort_test( |
| 10 |
"""import shutil |
| 11 |
import sys |
| 12 |
from io import StringIO |
| 13 |
from pathlib import Path |
| 14 |
from typing import ( |
| 15 |
Optional, |
| 16 |
TextIO, |
| 17 |
Union, |
| 18 |
cast |
| 19 |
) |
| 20 |
from warnings import warn |
| 21 |
|
| 22 |
from isort import core |
| 23 |
|
| 24 |
from . import io |
| 25 |
from .exceptions import ( |
| 26 |
ExistingSyntaxErrors, |
| 27 |
FileSkipComment, |
| 28 |
FileSkipSetting, |
| 29 |
IntroducedSyntaxErrors |
| 30 |
) |
| 31 |
from .format import ( |
| 32 |
ask_whether_to_apply_changes_to_file, |
| 33 |
create_terminal_printer, |
| 34 |
show_unified_diff |
| 35 |
) |
| 36 |
from .io import Empty |
| 37 |
from .place import module as place_module # noqa: F401 |
| 38 |
from .place import module_with_reason as place_module_with_reason # noqa: F401 |
| 39 |
from .settings import ( |
| 40 |
DEFAULT_CONFIG, |
| 41 |
Config |
| 42 |
) |
| 43 |
|
| 44 |
|
| 45 |
def sort_code_string( |
| 46 |
code: str, |
| 47 |
extension: Optional[str] = None, |
| 48 |
config: Config = DEFAULT_CONFIG, |
| 49 |
file_path: Optional[Path] = None, |
| 50 |
disregard_skip: bool = False, |
| 51 |
show_diff: Union[bool, TextIO] = False, |
| 52 |
**config_kwargs, |
| 53 |
): |
| 54 |
""" |
| 55 |
) |