feat: test with numeric/boolean style string
This commit is contained in:
parent
7f62590085
commit
0929c86af6
2 changed files with 13 additions and 5 deletions
|
|
@ -61,7 +61,7 @@ def get_rougail_config(test_dir, namespace=False, relative_to=None):
|
||||||
return rougailconfig
|
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"
|
# level is "all" or "mandatories"
|
||||||
|
|
||||||
if use_unrestraint:
|
if use_unrestraint:
|
||||||
|
|
@ -77,7 +77,7 @@ def get_values_for_config(config, specify_dynamic_id=True, level="all", use_unre
|
||||||
else:
|
else:
|
||||||
only = True
|
only = True
|
||||||
values = {}
|
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:
|
if not specify_dynamic_id:
|
||||||
for exclude in excludes:
|
for exclude in excludes:
|
||||||
_values = values
|
_values = values
|
||||||
|
|
@ -177,8 +177,10 @@ def get_value(variable, index, excludes, config, use_unrestraint):
|
||||||
return tests
|
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):
|
for idx, key in enumerate(config):
|
||||||
|
if key.name() == exclude_namespace:
|
||||||
|
continue
|
||||||
if not use_unrestraint and 'hidden' in key.property.get():
|
if not use_unrestraint and 'hidden' in key.property.get():
|
||||||
continue
|
continue
|
||||||
if key.isoptiondescription():
|
if key.isoptiondescription():
|
||||||
|
|
@ -194,14 +196,14 @@ def get_variables(root_config, config, values, only, excludes, specify_dynamic_i
|
||||||
has_value = False
|
has_value = False
|
||||||
for idx_, val in enumerate(leader_value):
|
for idx_, val in enumerate(leader_value):
|
||||||
value.append({})
|
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]:
|
if value[-1]:
|
||||||
has_value = True
|
has_value = True
|
||||||
if has_value:
|
if has_value:
|
||||||
values[key.name()] = value
|
values[key.name()] = value
|
||||||
else:
|
else:
|
||||||
value = {}
|
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:
|
if value:
|
||||||
values[key.name()] = value
|
values[key.name()] = value
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -15,3 +15,9 @@ var6:
|
||||||
description: the sixth variable
|
description: the sixth variable
|
||||||
type: string
|
type: string
|
||||||
default: value
|
default: value
|
||||||
|
var7:
|
||||||
|
description: the seventh variable
|
||||||
|
default: '8080'
|
||||||
|
var8:
|
||||||
|
description: the height variable
|
||||||
|
default: 'true'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue