From f2fd803b57fe2657b8584100b1a2d5574528ace7 Mon Sep 17 00:00:00 2001 From: DasMoorhuhn Date: Sun, 17 Dec 2023 19:31:35 +0100 Subject: [PATCH 1/3] yeet --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e95a73..73f6fb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,5 @@ pytest: image: python:3.12-alpine - only: - - main script: - sh tests/start_tests_gitlab.sh - sed -i "s#/builds/DasMoorhuhn/autopicture-v3/src#${CI_PROJECT_DIR}#g" coverage.xml From cdf8948193ae5c386351b4c1f300a32aecda4c5e Mon Sep 17 00:00:00 2001 From: DasMoorhuhn Date: Sun, 17 Dec 2023 21:15:06 +0100 Subject: [PATCH 2/3] did more tests --- src/config.py | 1 + tests/test_config.py | 19 +++++++++++++++++-- tests/test_process.py | 4 +++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/config.py b/src/config.py index 003cbfe..bdb3c8d 100644 --- a/src/config.py +++ b/src/config.py @@ -1,4 +1,5 @@ import yaml +import os config_file = "config.yml" diff --git a/tests/test_config.py b/tests/test_config.py index dbd737a..c17e3de 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,21 @@ import unittest +from src import config as config_module + class TestConfig(unittest.TestCase): - def test_config(self): - pass + def test_config_class(self): + test_config = { + "src": "/src/src", + "dst": "/src/dst" + } + + config = config_module.Config(test_config) + assert config.src == "/src/src" + assert config.dst == "/src/dst" + + 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" diff --git a/tests/test_process.py b/tests/test_process.py index 6cb6e7e..a97647e 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -1,10 +1,12 @@ import unittest from unittest.mock import Mock +from src import config from src.process import start_process +config.config_file = "src/config.yml" + -@unittest.skip("") class TestProcess(unittest.TestCase): def test_process(self): start_process(logger=Mock()) From 3c8974ee74ae37d3e7c4fc252c4680a13b8ca3f2 Mon Sep 17 00:00:00 2001 From: DasMoorhuhn Date: Sun, 17 Dec 2023 21:36:32 +0100 Subject: [PATCH 3/3] activate apple test --- tests/test_with_real_data.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_with_real_data.py b/tests/test_with_real_data.py index e05068c..aeddb93 100644 --- a/tests/test_with_real_data.py +++ b/tests/test_with_real_data.py @@ -42,8 +42,11 @@ class TestSamsung(unittest.TestCase): assert image.make == "samsung" -@unittest.skip("") class TestApple(unittest.TestCase): - def test_iphone(self): - pass + def test_iphone_x(self): + copy_images(brand="iphone", model="x") + files = recursive_scan_folder(path=TEST_FOLDER) + meta_data = get_meta_data(images=files) + for image in meta_data: + assert image.make == "Apple"