From fd3eb9b8319675ee84cdfb121c67dd163af47f0b Mon Sep 17 00:00:00 2001 From: mlbonhomme <bonhomme@teklia.com> Date: Wed, 29 Jun 2022 16:20:10 +0200 Subject: [PATCH] no updating self.config --- arkindex_worker/worker/base.py | 4 ++-- tests/test_base_worker.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arkindex_worker/worker/base.py b/arkindex_worker/worker/base.py index a7f5e6c8..65d11da6 100644 --- a/arkindex_worker/worker/base.py +++ b/arkindex_worker/worker/base.py @@ -171,12 +171,12 @@ class BaseWorker(object): ) self.config = worker_version["configuration"]["configuration"] if "user_configuration" in worker_version["configuration"]: - # Add default values (if set) from user configurable parameters to the base configuration + # Add default values (if set) to user_configuration for key, value in worker_version["configuration"][ "user_configuration" ].items(): if "default" in value: - self.config.update({key: value["default"]}) + self.user_configuration.update({key: value["default"]}) self.worker_details = worker_version["worker"] required_secrets = worker_version["configuration"].get("secrets", []) elif self.args.config: diff --git a/tests/test_base_worker.py b/tests/test_base_worker.py index df50e02e..d0c63fa4 100644 --- a/tests/test_base_worker.py +++ b/tests/test_base_worker.py @@ -211,9 +211,8 @@ def test_configure_user_configuration_defaults( ) worker.configure() - assert worker.config == { - "param_1": "/some/path/file.pth", - "param_2": 12, + assert worker.config == {"param_1": "/some/path/file.pth", "param_2": 12} + assert worker.user_configuration == { "param_3": "Animula vagula blandula", "param_5": True, } -- GitLab