Skip to content

Commit

Permalink
adds testcase for normalize_path with path outside of root
Browse files Browse the repository at this point in the history
  • Loading branch information
n-borges committed Aug 4, 2022
1 parent 79a1d91 commit 3daf8a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,18 @@ def test_normalize_path_ignore_windows_junctions_outside_of_root(self) -> None:

self.assertEqual(normalized_path, None)

def test_normalize_path_outside_of_root(self) -> None:

with TemporaryDirectory() as workspace:
root = Path(workspace)
target_path = root / ".."
report = black.Report(verbose=True)
normalized_path = black.normalize_path_maybe_ignore(
target_path, root, report
)

self.assertNotEqual(normalized_path, None)

def test_newline_comment_interaction(self) -> None:
source = "class A:\\\r\n# type: ignore\n pass\n"
output = black.format_str(source, mode=DEFAULT_MODE)
Expand Down

0 comments on commit 3daf8a7

Please sign in to comment.