Skip to content

Commit 3daf8a7

Browse files
committed
adds testcase for normalize_path with path outside of root
1 parent 79a1d91 commit 3daf8a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_black.py

+12
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,18 @@ def test_normalize_path_ignore_windows_junctions_outside_of_root(self) -> None:
14551455

14561456
self.assertEqual(normalized_path, None)
14571457

1458+
def test_normalize_path_outside_of_root(self) -> None:
1459+
1460+
with TemporaryDirectory() as workspace:
1461+
root = Path(workspace)
1462+
target_path = root / ".."
1463+
report = black.Report(verbose=True)
1464+
normalized_path = black.normalize_path_maybe_ignore(
1465+
target_path, root, report
1466+
)
1467+
1468+
self.assertNotEqual(normalized_path, None)
1469+
14581470
def test_newline_comment_interaction(self) -> None:
14591471
source = "class A:\\\r\n# type: ignore\n pass\n"
14601472
output = black.format_str(source, mode=DEFAULT_MODE)

0 commit comments

Comments
 (0)