updated test script

This commit is contained in:
Kevin Veen-Birkenbach 2023-11-14 13:18:30 +01:00
parent 62dc1e1250
commit a505cfa8d3
2 changed files with 8 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
test_dir1 test_dir*
test_dir2

View File

@ -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]}") duplicate = os.path.join(dir, f"dup_{dup_num}_{file_names[i]}")
shutil.copyfile(original, duplicate) 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): def create_file_structure(depth, num_files, duplicate_files):
base_dirs = ['test_dir1', 'test_dir2'] base_dirs = ['test_dir1', 'test_dir2']
for base_dir in base_dirs: for base_dir in base_dirs:
create_test_directory(base_dir, num_files, duplicate_files, depth) create_test_directory(base_dir, num_files, duplicate_files, depth)
copy_directory_contents('test_dir1', 'test_dir3')
print("Test file structure created.") print("Test file structure created.")
if __name__ == "__main__": if __name__ == "__main__":