added test files

This commit is contained in:
2023-12-12 00:35:36 +01:00
parent fc9ce09e0f
commit 0cf66c5781
9 changed files with 43 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ import os
import shutil
from pathlib import Path
from src.scan_folder import recursive_scan_folder
TEST_FOLDER = ".test_folder"
TEST_IMAGES = "tests/test_files"
TEST_TEMP_FOLDER = os.path.join(TEST_FOLDER, 'Temp')
@@ -28,3 +30,15 @@ def copy_test_images():
os.makedirs(TEST_IMAGE_FOLDER)
shutil.copy(src=os.path.join(TEST_IMAGES, 'test_image_001.JPG'), dst=TEST_TEMP_FOLDER)
shutil.copy(src=os.path.join(TEST_IMAGES, 'test_image_002.JPG'), dst=TEST_TEMP_FOLDER)
def copy_images(brand:str, model:str):
delete_folder()
create_folders()
files = recursive_scan_folder(path=TEST_IMAGES)
for file in files:
file_name = file.split("/")[2:][0]
file_name = file_name.split("_")
if file_name[0] == brand and file_name[1] == model:
shutil.copy(src=file, dst=TEST_FOLDER)