mirror of https://github.com/CIRCL/PyCIRCLean
parent
c723f90611
commit
a834cfea39
|
@ -326,7 +326,7 @@ class File(FileBase):
|
||||||
def make_tempdir(self) -> Path:
|
def make_tempdir(self) -> Path:
|
||||||
"""Make a temporary directory at self.tempdir_path."""
|
"""Make a temporary directory at self.tempdir_path."""
|
||||||
if not self.tempdir_path.exists():
|
if not self.tempdir_path.exists():
|
||||||
self.tempdir_path.mkdir()
|
self.tempdir_path.mkdir(parents=True)
|
||||||
return self.tempdir_path
|
return self.tempdir_path
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
|
|
|
@ -316,7 +316,7 @@ class KittenGroomerBase(object):
|
||||||
def safe_mkdir(self, directory_path: Path):
|
def safe_mkdir(self, directory_path: Path):
|
||||||
"""Make a directory if it does not exist."""
|
"""Make a directory if it does not exist."""
|
||||||
if not directory_path.exists():
|
if not directory_path.exists():
|
||||||
os.makedirs(directory_path)
|
directory_path.mkdir(parents=True)
|
||||||
|
|
||||||
def list_all_files(self, directory_path: Path) -> Iterator[Path]:
|
def list_all_files(self, directory_path: Path) -> Iterator[Path]:
|
||||||
"""Generator yielding path to all of the files in a directory tree."""
|
"""Generator yielding path to all of the files in a directory tree."""
|
||||||
|
|
|
@ -254,7 +254,7 @@ class TestFileBase:
|
||||||
file = FileBase(file_path, dst_path)
|
file = FileBase(file_path, dst_path)
|
||||||
with mock.patch('kittengroomer.helpers.shutil.copy') as mock_copy:
|
with mock.patch('kittengroomer.helpers.shutil.copy') as mock_copy:
|
||||||
file.safe_copy()
|
file.safe_copy()
|
||||||
mock_copy.assert_called_once_with(str(file_path), str(dst_path))
|
mock_copy.assert_called_once_with(file_path, dst_path)
|
||||||
|
|
||||||
def test_safe_copy_removes_exec_perms(self):
|
def test_safe_copy_removes_exec_perms(self):
|
||||||
"""`safe_copy` should create a file that doesn't have any of the
|
"""`safe_copy` should create a file that doesn't have any of the
|
||||||
|
|
Loading…
Reference in New Issue