From 63bf7f76407da58ef0ad4ef99b95e116acf76d50 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 13 Jul 2025 18:02:44 +0200 Subject: [PATCH] Removed legacy code function --- filter_plugins/configuration_filters.py | 8 -------- tests/legacy/README.md | 5 +++++ tests/legacy/__init__.py | 0 .../test_configuration_filters.py | 12 +++++++----- 4 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 tests/legacy/README.md create mode 100644 tests/legacy/__init__.py rename tests/{unit/filter_plugins => legacy}/test_configuration_filters.py (69%) diff --git a/filter_plugins/configuration_filters.py b/filter_plugins/configuration_filters.py index ef0c837b..bd9e6e7b 100644 --- a/filter_plugins/configuration_filters.py +++ b/filter_plugins/configuration_filters.py @@ -1,11 +1,3 @@ -from get_app_conf import get_app_conf - -def is_feature_enabled(applications: dict, feature: str, application_id: str) -> bool: - """ - Wrapper for compatibility: Return True if applications[application_id].features[feature] is truthy. - """ - return bool(get_app_conf(applications, application_id, f"features.{feature}", strict=False)) - def get_docker_compose(path_docker_compose_instances: str, application_id: str) -> dict: """ Build the docker_compose dict based on diff --git a/tests/legacy/README.md b/tests/legacy/README.md new file mode 100644 index 00000000..4f32fe95 --- /dev/null +++ b/tests/legacy/README.md @@ -0,0 +1,5 @@ +# Legacy Tests + +This are tests which had been written for old code, but which had been modified to test restructured new code. + +They shouldn't have high impacts on the stability of the system and propably could be deleted. \ No newline at end of file diff --git a/tests/legacy/__init__.py b/tests/legacy/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/filter_plugins/test_configuration_filters.py b/tests/legacy/test_configuration_filters.py similarity index 69% rename from tests/unit/filter_plugins/test_configuration_filters.py rename to tests/legacy/test_configuration_filters.py index e7c90001..02d787ca 100644 --- a/tests/unit/filter_plugins/test_configuration_filters.py +++ b/tests/legacy/test_configuration_filters.py @@ -5,15 +5,17 @@ import os sys.path.insert( 0, os.path.abspath( - os.path.join(os.path.dirname(__file__), "../../../") + os.path.join(os.path.dirname(__file__), "../../") ), ) -from filter_plugins.configuration_filters import ( - is_feature_enabled, -) +from filter_plugins.get_app_conf import AppConfigKeyError, get_app_conf -from filter_plugins.get_app_conf import AppConfigKeyError +def is_feature_enabled(applications: dict, feature: str, application_id: str) -> bool: + """ + Wrapper for compatibility: Return True if applications[application_id].features[feature] is truthy. + """ + return bool(get_app_conf(applications, application_id, f"features.{feature}", strict=False)) class TestConfigurationFilters(unittest.TestCase):