From a505cfa8d32422472a7c6bb0394cca4c4b7d55a2 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 14 Nov 2023 13:18:30 +0100 Subject: [PATCH] updated test script --- .gitignore | 3 +-- create_file_structure.py | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 84c0a09..9ec79b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -test_dir1 -test_dir2 \ No newline at end of file +test_dir* \ No newline at end of file diff --git a/create_file_structure.py b/create_file_structure.py index 7c5d61a..ecc4c04 100644 --- a/create_file_structure.py +++ b/create_file_structure.py @@ -23,11 +23,18 @@ def create_test_directory(base_dir, num_files=5, duplicate_files=2, depth=1): duplicate = os.path.join(dir, f"dup_{dup_num}_{file_names[i]}") shutil.copyfile(original, duplicate) +def copy_directory_contents(src, dst): + if os.path.exists(dst): + shutil.rmtree(dst) + shutil.copytree(src, dst) + def create_file_structure(depth, num_files, duplicate_files): base_dirs = ['test_dir1', 'test_dir2'] for base_dir in base_dirs: create_test_directory(base_dir, num_files, duplicate_files, depth) + copy_directory_contents('test_dir1', 'test_dir3') + print("Test file structure created.") if __name__ == "__main__":