From 9f314481345b67870e0895731d4d1105001da723 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 1 Oct 2024 18:16:00 +0200 Subject: [PATCH] list comprehension --- tests/test_load.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_load.py b/tests/test_load.py index b39f673..444db17 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -98,7 +98,12 @@ def populate(dest_dir, rougailconfig): root_config = config.unrestraint else: root_config = config.unrestraint.value.mandatory() - values = ['ROUGAIL_' + variable.path().upper() + '="' + "" if get_value(variable) is None else get_value(variable) + '"' for variable in get_variables(root_config)] + values = [] + for variable in get_variables(root_config): + var = get_value(variable) + if var is None: + var = "" + values.append('ROUGAIL_' + variable.path().upper() + '="' + var + '"') if not environment_file.is_file(): with environment_file.open('w') as envfh: envfh.write('\n'.join(values) + '\n')