i18n, tests and more
This commit is contained in:
@@ -5,7 +5,7 @@ from pathlib import Path
|
||||
from src.scan_folder import recursive_scan_folder
|
||||
|
||||
TEST_FOLDER = ".test_folder"
|
||||
TEST_IMAGES = "tests/test_files"
|
||||
TEST_IMAGES = f"tests{os.sep}test_files"
|
||||
TEST_TEMP_FOLDER = os.path.join(TEST_FOLDER, 'Temp')
|
||||
TEST_IMAGE_FOLDER = os.path.join(TEST_FOLDER, 'Images')
|
||||
|
||||
@@ -37,7 +37,7 @@ def copy_images(brand:str, model:str):
|
||||
create_folders()
|
||||
files = recursive_scan_folder(path=TEST_IMAGES)
|
||||
for file in files:
|
||||
file_name = file.split("/")[2:][0]
|
||||
file_name = file.split(os.sep)[2:][0]
|
||||
file_name = file_name.split("_")
|
||||
if file_name[0] == brand and file_name[1] == model:
|
||||
shutil.copy(src=file, dst=TEST_FOLDER)
|
||||
|
||||
@@ -6,3 +6,5 @@ python3.12 -m pytest \
|
||||
--cov-report xml:tests/coverage/coverage.xml \
|
||||
--junitxml=tests/coverage/report.xml \
|
||||
tests/
|
||||
|
||||
exit $?
|
||||
|
||||
@@ -3,8 +3,10 @@ pip3.12 install -r requirements.txt
|
||||
pip3.12 install -r develop_requirements.txt
|
||||
pwd
|
||||
sh tests/start_tests.sh
|
||||
exit_code=$?
|
||||
|
||||
cp tests/coverage/coverage.xml ./coverage.xml
|
||||
cp tests/coverage/report.xml ./report.xml
|
||||
|
||||
python3.12 tests/get_coverage_percent.py
|
||||
exit $exit_code
|
||||
@@ -7,15 +7,18 @@ class TestConfig(unittest.TestCase):
|
||||
def test_config_class(self):
|
||||
test_config = {
|
||||
"src": "/src/src",
|
||||
"dst": "/src/dst"
|
||||
"dst": "/src/dst",
|
||||
"language": "en"
|
||||
}
|
||||
|
||||
config = config_module.Config(test_config)
|
||||
assert config.src == "/src/src"
|
||||
assert config.dst == "/src/dst"
|
||||
assert config.language == "en"
|
||||
|
||||
def test_get_config(self):
|
||||
config_module.config_file = "src/config.yml"
|
||||
config = config_module.get_config()
|
||||
assert config.src == "../app/Temp"
|
||||
assert config.dst == "../app/Bilder"
|
||||
assert config.language == "en"
|
||||
|
||||
1
tests/tests/coverage/report.xml
Normal file
1
tests/tests/coverage/report.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="0" time="0.024" timestamp="2024-03-17T01:13:57.781687" hostname="framework-13" /></testsuites>
|
||||
Reference in New Issue
Block a user