Skip to content

Commit 23df174

Browse files
committed
refractor
1 parent 0e0c6e3 commit 23df174

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib_path/lib_path.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ def log_and_raise_if_target_directory_within_source_directory(path_source_dir: p
7676
>>> path_target_dir_ok=pathlib.Path('./test2/test')
7777
>>> path_target_dir_err=pathlib.Path('./test/test2')
7878
79-
>>> # Test OK
80-
>>> log_and_raise_if_target_directory_within_source_directory(path_source_dir, path_target_dir_ok)
81-
8279
>>> # Test ERR
8380
>>> log_and_raise_if_target_directory_within_source_directory(path_source_dir, path_target_dir_err)
8481
Traceback (most recent call last):
8582
...
8683
FileExistsError: target directory: "..." is within the source directory "..."
8784
85+
86+
>>> # Test OK
87+
>>> log_and_raise_if_target_directory_within_source_directory(path_source_dir, path_target_dir_ok)
88+
89+
8890
"""
8991
if is_target_directory_within_source_directory(path_source_dir, path_target_dir):
9092
s_error = 'target directory: "{}" is within the source directory "{}"'.format(path_target_dir, path_source_dir)
@@ -95,6 +97,7 @@ def log_and_raise_if_target_directory_within_source_directory(path_source_dir: p
9597
def is_target_directory_within_source_directory(path_source_dir: pathlib.Path, path_target_dir: pathlib.Path) -> bool:
9698
s_source_dir = str(path_source_dir.resolve()) + '/'
9799
s_target_dir = str(path_target_dir.resolve()) + '/'
100+
logger.error('S:' + s_source_dir + ' T:' + s_target_dir)
98101
if s_target_dir.startswith(s_source_dir):
99102
return True
100103
else:

0 commit comments

Comments
 (0)