From 0929c86af6ab1cebbe02d2e83d30f378648c6ce7 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 30 Sep 2025 06:25:50 +0200 Subject: [PATCH] feat: test with numeric/boolean style string --- src/rougail_tests/utils.py | 12 +++++++----- structures/00_6string/rougail/00-base.yml | 6 ++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/rougail_tests/utils.py b/src/rougail_tests/utils.py index dbddb46..4d34cf5 100644 --- a/src/rougail_tests/utils.py +++ b/src/rougail_tests/utils.py @@ -61,7 +61,7 @@ def get_rougail_config(test_dir, namespace=False, relative_to=None): return rougailconfig -def get_values_for_config(config, specify_dynamic_id=True, level="all", use_unrestraint=True): +def get_values_for_config(config, specify_dynamic_id=True, level="all", use_unrestraint=True, exclude_namespace=None): # level is "all" or "mandatories" if use_unrestraint: @@ -77,7 +77,7 @@ def get_values_for_config(config, specify_dynamic_id=True, level="all", use_unre else: only = True values = {} - get_variables(root_config, root_config, values, only, excludes, specify_dynamic_id, use_unrestraint) + get_variables(root_config, root_config, values, only, excludes, specify_dynamic_id, use_unrestraint, exclude_namespace) if not specify_dynamic_id: for exclude in excludes: _values = values @@ -177,8 +177,10 @@ def get_value(variable, index, excludes, config, use_unrestraint): return tests -def get_variables(root_config, config, values, only, excludes, specify_dynamic_id, use_unrestraint, *, index=None, leader_is_mandatory=False): +def get_variables(root_config, config, values, only, excludes, specify_dynamic_id, use_unrestraint, exclude_namespace, *, index=None, leader_is_mandatory=False): for idx, key in enumerate(config): + if key.name() == exclude_namespace: + continue if not use_unrestraint and 'hidden' in key.property.get(): continue if key.isoptiondescription(): @@ -194,14 +196,14 @@ def get_variables(root_config, config, values, only, excludes, specify_dynamic_i has_value = False for idx_, val in enumerate(leader_value): value.append({}) - get_variables(root_config, key, value[-1], only, excludes, specify_dynamic_id, use_unrestraint, index=idx_, leader_is_mandatory=leader_is_mandatory) + get_variables(root_config, key, value[-1], only, excludes, specify_dynamic_id, use_unrestraint, None, index=idx_, leader_is_mandatory=leader_is_mandatory) if value[-1]: has_value = True if has_value: values[key.name()] = value else: value = {} - get_variables(root_config, key, value, only, excludes, specify_dynamic_id, use_unrestraint) + get_variables(root_config, key, value, only, excludes, specify_dynamic_id, use_unrestraint, None) if value: values[key.name()] = value else: diff --git a/structures/00_6string/rougail/00-base.yml b/structures/00_6string/rougail/00-base.yml index 2d48524..73fb785 100644 --- a/structures/00_6string/rougail/00-base.yml +++ b/structures/00_6string/rougail/00-base.yml @@ -15,3 +15,9 @@ var6: description: the sixth variable type: string default: value +var7: + description: the seventh variable + default: '8080' +var8: + description: the height variable + default: 'true'