From 463b57ea2d42cf203dee9490f1de71d0d2ac0c91 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 9 Apr 2024 11:58:33 +0200 Subject: [PATCH 01/10] feat: add default inference for basic types --- src/rougail/annotator/value.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 18fc01251..9f5d595ff 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -62,6 +62,14 @@ class Annotator(Walk): # pylint: disable=R0903 variable: dict, ) -> None: multi = self.objectspace.multis.get(variable.path, False) + + types = {str: "string", int: "number", bool: "boolean", float: "float"} + + # variable's type inference with a default value with a basic type + if multi is False and variable.type == "string" and type(variable.default) != str: + if type(variable.default) in types: + variable.type = types[type(variable.default)] + # a boolean must have value, the default value is "True" if variable.type == "boolean" and multi is False and variable.default is None: variable.default = True -- 2.45.0 From e006438cf4ad247caa7840422c1e478fcc43278a Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 30 Apr 2024 10:33:55 +0200 Subject: [PATCH 02/10] feat: add default inference for basic types preparation of moving the calculation of the variable's type from the class Variable to a dynamic calculation in the annotations (mainly in `annotator/value.py`) --- src/rougail/annotator/value.py | 3 +++ src/rougail/convert.py | 20 +++++++------------- src/rougail/object_model.py | 8 +++++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 9f5d595ff..b2e04b0ad 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -66,6 +66,9 @@ class Annotator(Walk): # pylint: disable=R0903 types = {str: "string", int: "number", bool: "boolean", float: "float"} # variable's type inference with a default value with a basic type + ## XXX hack: convert None to string + variable.type = "string" + ## XXX gérer le comportement suivant les versions if multi is False and variable.type == "string" and type(variable.default) != str: if type(variable.default) in types: variable.type = types[type(variable.default)] diff --git a/src/rougail/convert.py b/src/rougail/convert.py index d98f76d03..c5024874f 100644 --- a/src/rougail/convert.py +++ b/src/rougail/convert.py @@ -55,7 +55,7 @@ from .object_model import ( CONVERT_OPTION, Family, Dynamic, - _Variable, + Variable, Choice, SymLink, CALCULATION_TYPES, @@ -98,7 +98,7 @@ class Property: class Paths: def __init__(self) -> None: - self._data: Dict[str, Union[_Variable, Family]] = {} + self._data: Dict[str, Union[Variable, Family]] = {} self._dynamics: List[str] = [] self.path_prefix = None @@ -167,7 +167,7 @@ class Paths: def __getitem__( self, path: str, - ) -> Union[Family, _Variable]: + ) -> Union[Family, Variable]: if not path in self._data: raise AttributeError(f"cannot find variable or family {path}") return self._data[path] @@ -248,18 +248,10 @@ class ParserVariable: self.is_init = False super().__init__() - def get_variable(self): - - class Variable(_Variable): - #type: Literal[*convert_options] = convert_options[0] - type: str = self.convert_options[0] - - return Variable - def init(self): if self.is_init: return - self.variable = self.get_variable() + self.variable = Variable hint = get_type_hints(self.dynamic) self.family_types = hint["type"].__args__ # pylint: disable=W0201 self.family_attrs = frozenset( # pylint: disable=W0201 @@ -605,6 +597,7 @@ class ParserVariable: obj, filename, family_is_dynamic, + version ) if family_is_leadership: if first_variable: @@ -680,6 +673,7 @@ class ParserVariable: variable: dict, filename: str, family_is_dynamic: bool, + version: str ) -> None: """Add a new variable""" if not isinstance(filename, list): @@ -724,7 +718,7 @@ class ParserVariable: ############################################################################################### def set_name( self, - obj: Union[_Variable, Family], + obj: Union[Variable, Family], option_prefix: str, ): """Set Tiramisu object name""" diff --git a/src/rougail/object_model.py b/src/rougail/object_model.py index 42816d6a6..224139de8 100644 --- a/src/rougail/object_model.py +++ b/src/rougail/object_model.py @@ -422,7 +422,7 @@ class Dynamic(Family): dynamic: Optional[BASETYPE_CALC] -class _Variable(BaseModel): +class Variable(BaseModel): name: str description: Optional[str] = None default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None @@ -439,11 +439,13 @@ class _Variable(BaseModel): test: Optional[list] = None xmlfiles: List[str] = [] path: str + # type will be set dynamically in `annotator/value.py`, default is None + type: str = None model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True) -class Choice(_Variable): +class Choice(Variable): type: Literal["choice"] = "choice" choices: Union[List[BASETYPE_CALC], Calculation] @@ -451,7 +453,7 @@ class Choice(_Variable): class SymLink(BaseModel): name: str type: Literal["symlink"] = "symlink" - opt: _Variable + opt: Variable xmlfiles: List[str] = [] path: str -- 2.45.0 From baa1968b261b8e4896010ad3c5189794f0c46735 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 30 Apr 2024 15:20:06 +0200 Subject: [PATCH 03/10] feat: default inference, calculation of the variable's type --- src/rougail/annotator/value.py | 25 ++++++++++++++----------- src/rougail/convert.py | 1 + src/rougail/object_model.py | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index b2e04b0ad..705052859 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -62,17 +62,20 @@ class Annotator(Walk): # pylint: disable=R0903 variable: dict, ) -> None: multi = self.objectspace.multis.get(variable.path, False) - - types = {str: "string", int: "number", bool: "boolean", float: "float"} - - # variable's type inference with a default value with a basic type - ## XXX hack: convert None to string - variable.type = "string" - ## XXX gérer le comportement suivant les versions - if multi is False and variable.type == "string" and type(variable.default) != str: - if type(variable.default) in types: - variable.type = types[type(variable.default)] - + # variable's type inference from a default value with :term:`basic types` + basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} + if variable.version == "1.0": + # - version: 1.0, the default value is of type "string" by default + if variable.type is None: + variable.type = "string" + elif variable.version == "1.1": + # - version: 1.1, the default value has no type by default + if multi is False and variable.type is None: + if type(variable.default) in basic_types: + variable.type = basic_types[type(variable.default)] + else: + # XXX FIXME strange. weird. not good + variable.type = "string" # a boolean must have value, the default value is "True" if variable.type == "boolean" and multi is False and variable.default is None: variable.default = True diff --git a/src/rougail/convert.py b/src/rougail/convert.py index c5024874f..11dd9c893 100644 --- a/src/rougail/convert.py +++ b/src/rougail/convert.py @@ -679,6 +679,7 @@ class ParserVariable: if not isinstance(filename, list): filename = [filename] variable["xmlfiles"] = filename + variable["version"] = version variable_type = self.get_family_or_variable_type(variable) obj = { "symlink": SymLink, diff --git a/src/rougail/object_model.py b/src/rougail/object_model.py index 224139de8..a9631dad7 100644 --- a/src/rougail/object_model.py +++ b/src/rougail/object_model.py @@ -439,6 +439,7 @@ class Variable(BaseModel): test: Optional[list] = None xmlfiles: List[str] = [] path: str + version: str # type will be set dynamically in `annotator/value.py`, default is None type: str = None -- 2.45.0 From 035fd7bd7e3f5452ae5d1918fb94b00541992081 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 21 May 2024 15:38:41 +0200 Subject: [PATCH 04/10] feat: set automatically the choice type --- src/rougail/annotator/value.py | 10 ++++++---- src/rougail/annotator/variable.py | 5 +++++ src/rougail/convert.py | 4 ++-- src/rougail/object_model.py | 7 ++++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 705052859..aeec99b54 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -62,20 +62,22 @@ class Annotator(Walk): # pylint: disable=R0903 variable: dict, ) -> None: multi = self.objectspace.multis.get(variable.path, False) - # variable's type inference from a default value with :term:`basic types` + + # default type inference from a default value with :term:`basic types` basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} if variable.version == "1.0": # - version: 1.0, the default value is of type "string" by default if variable.type is None: variable.type = "string" - elif variable.version == "1.1": + else: #if variable.version != "1.0": # - version: 1.1, the default value has no type by default if multi is False and variable.type is None: if type(variable.default) in basic_types: variable.type = basic_types[type(variable.default)] else: - # XXX FIXME strange. weird. not good - variable.type = "string" + if variable.type is None: + variable.type = "string" + # a boolean must have value, the default value is "True" if variable.type == "boolean" and multi is False and variable.default is None: variable.default = True diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index e5ffa5f91..5e9a6d2df 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -79,6 +79,11 @@ class Annotator(Walk): # pylint: disable=R0903 for variable in self.get_variables(): if variable.type == "symlink": continue + # choice type inference from the `choices` attribute + if variable.version != "1.0": + if variable.choices is not None: + if variable.type is None: + variable.type = "choice" self._convert_variable(variable) def _convert_variable( diff --git a/src/rougail/convert.py b/src/rougail/convert.py index 11dd9c893..0f6a59217 100644 --- a/src/rougail/convert.py +++ b/src/rougail/convert.py @@ -56,7 +56,7 @@ from .object_model import ( Family, Dynamic, Variable, - Choice, + #Choice, SymLink, CALCULATION_TYPES, Calculation, @@ -237,7 +237,7 @@ class ParserVariable: # self.family = Family self.dynamic = Dynamic - self.choice = Choice + self.choice = Variable #Choice # self.exclude_imports = [] self.informations = Informations() diff --git a/src/rougail/object_model.py b/src/rougail/object_model.py index a9631dad7..1de66076a 100644 --- a/src/rougail/object_model.py +++ b/src/rougail/object_model.py @@ -442,13 +442,14 @@ class Variable(BaseModel): version: str # type will be set dynamically in `annotator/value.py`, default is None type: str = None + choices: Union[None, List[BASETYPE_CALC], Calculation] model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True) -class Choice(Variable): - type: Literal["choice"] = "choice" - choices: Union[List[BASETYPE_CALC], Calculation] +#class Choice(Variable): +# type: Literal["choice"] = "choice" +# choices: Union[List[BASETYPE_CALC], Calculation] class SymLink(BaseModel): -- 2.45.0 From 955b293403d76cfaa29349cc6de1c6249c8a2690 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 4 Jun 2024 12:05:05 +0200 Subject: [PATCH 05/10] feat: default type inference --- src/rougail/annotator/value.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index aeec99b54..6bfda4326 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -74,9 +74,19 @@ class Annotator(Walk): # pylint: disable=R0903 if multi is False and variable.type is None: if type(variable.default) in basic_types: variable.type = basic_types[type(variable.default)] - else: + elif isinstance(variable.default, list): + #if variable.name == "varname23": + # print("IIIIIIIIIIIIIIIIIIIIIIIIIIIII") + # print(variable.multi) + if variable.multi is None or variable.multi is False: + variable.multi = True if variable.type is None: - variable.type = "string" + variable.type = basic_types[type(variable.default[0])] + #if variable.name == "varname23": + # print(variable.multi) + # print(variable.type) + else: + variable.type = "string" # a boolean must have value, the default value is "True" if variable.type == "boolean" and multi is False and variable.default is None: @@ -89,9 +99,9 @@ class Annotator(Walk): # pylint: disable=R0903 pass # variable.default = variable.default.to_function(self.functions) elif isinstance(variable.default, list): - if not multi: + if not multi and variable.version == "1.0": raise Exception( - f'The variable "{variable.path}" with a list has default value must have "multi" attribute' + f'The variable "{variable.path}" with a list as default value must have "multi" attribute' ) if variable.path in self.objectspace.followers: if multi != "submulti" and len(variable.default) != 1: -- 2.45.0 From 57f785250157d013a850a784ccc53b937f1273c4 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 4 Jun 2024 16:21:18 +0200 Subject: [PATCH 06/10] feat: find automatically the type for a multi in case the "multi" attribute is not set, infers the type --- src/rougail/annotator/value.py | 26 -------------------------- src/rougail/annotator/variable.py | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 6bfda4326..a3981087b 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -62,32 +62,6 @@ class Annotator(Walk): # pylint: disable=R0903 variable: dict, ) -> None: multi = self.objectspace.multis.get(variable.path, False) - - # default type inference from a default value with :term:`basic types` - basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} - if variable.version == "1.0": - # - version: 1.0, the default value is of type "string" by default - if variable.type is None: - variable.type = "string" - else: #if variable.version != "1.0": - # - version: 1.1, the default value has no type by default - if multi is False and variable.type is None: - if type(variable.default) in basic_types: - variable.type = basic_types[type(variable.default)] - elif isinstance(variable.default, list): - #if variable.name == "varname23": - # print("IIIIIIIIIIIIIIIIIIIIIIIIIIIII") - # print(variable.multi) - if variable.multi is None or variable.multi is False: - variable.multi = True - if variable.type is None: - variable.type = basic_types[type(variable.default[0])] - #if variable.name == "varname23": - # print(variable.multi) - # print(variable.type) - else: - variable.type = "string" - # a boolean must have value, the default value is "True" if variable.type == "boolean" and multi is False and variable.default is None: variable.default = True diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index 5e9a6d2df..2233faa3d 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -86,6 +86,29 @@ class Annotator(Walk): # pylint: disable=R0903 variable.type = "choice" self._convert_variable(variable) + multi = self.objectspace.multis.get(variable.path, False) + # default type inference from a default value with :term:`basic types` + basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} + if variable.version == "1.0": + # - version: 1.0, the default value is of type "string" by default + if variable.type is None: + variable.type = "string" + else: #if variable.version != "1.0": + # - version: 1.1, the default value has no type by default + if multi is False and variable.type is None: + if type(variable.default) in basic_types: + variable.type = basic_types[type(variable.default)] + elif isinstance(variable.default, list): + if variable.multi is None or variable.multi is False: + variable.multi = True + if variable.type is None: + variable.type = basic_types[type(variable.default[0])] + #else: + # variable.type = "string" + # let's update the "multi" attribute in the tiramisu cache then + if variable.multi == True: + self.objectspace.multis[variable.path] = True + def _convert_variable( self, variable: dict, -- 2.45.0 From c7a9772d0ebe755eea0196bc03e1eacd35429487 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 18 Jun 2024 16:02:20 +0200 Subject: [PATCH 07/10] choices is None by default --- src/rougail/annotator/variable.py | 43 ++++++++++++++++--------------- src/rougail/object_model.py | 2 +- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index 2233faa3d..d8d1d60f4 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -76,6 +76,9 @@ class Annotator(Walk): # pylint: disable=R0903 def convert_variable(self): """convert variable""" + # default type inference from a default value with :term:`basic types` + basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} + for variable in self.get_variables(): if variable.type == "symlink": continue @@ -86,28 +89,26 @@ class Annotator(Walk): # pylint: disable=R0903 variable.type = "choice" self._convert_variable(variable) - multi = self.objectspace.multis.get(variable.path, False) - # default type inference from a default value with :term:`basic types` - basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} - if variable.version == "1.0": - # - version: 1.0, the default value is of type "string" by default - if variable.type is None: - variable.type = "string" - else: #if variable.version != "1.0": - # - version: 1.1, the default value has no type by default - if multi is False and variable.type is None: - if type(variable.default) in basic_types: - variable.type = basic_types[type(variable.default)] - elif isinstance(variable.default, list): - if variable.multi is None or variable.multi is False: - variable.multi = True + multi = self.objectspace.multis.get(variable.path, False) + if variable.version == "1.0": + # - version: 1.0, the default value is of type "string" by default if variable.type is None: - variable.type = basic_types[type(variable.default[0])] - #else: - # variable.type = "string" - # let's update the "multi" attribute in the tiramisu cache then - if variable.multi == True: - self.objectspace.multis[variable.path] = True + variable.type = "string" + else: #if variable.version != "1.0": + # - version: 1.1, the default value has no type by default + if multi is False and variable.type is None: + if type(variable.default) in basic_types: + variable.type = basic_types[type(variable.default)] + elif isinstance(variable.default, list): + if variable.multi is None or variable.multi is False: + variable.multi = True + if variable.type is None: + variable.type = basic_types[type(variable.default[0])] + #else: + # variable.type = "string" + # let's update the "multi" attribute in the tiramisu cache then + if variable.multi == True: + self.objectspace.multis[variable.path] = True def _convert_variable( self, diff --git a/src/rougail/object_model.py b/src/rougail/object_model.py index 1de66076a..cf4776830 100644 --- a/src/rougail/object_model.py +++ b/src/rougail/object_model.py @@ -442,7 +442,7 @@ class Variable(BaseModel): version: str # type will be set dynamically in `annotator/value.py`, default is None type: str = None - choices: Union[None, List[BASETYPE_CALC], Calculation] + choices: Union[None, List[BASETYPE_CALC], Calculation] = None model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True) -- 2.45.0 From ff8aa6478398f747b4a8a33d540b4626155fcb6a Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 18 Jun 2024 17:25:04 +0200 Subject: [PATCH 08/10] multis --- src/rougail/annotator/variable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index d8d1d60f4..c9cb8ecc9 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -107,7 +107,7 @@ class Annotator(Walk): # pylint: disable=R0903 #else: # variable.type = "string" # let's update the "multi" attribute in the tiramisu cache then - if variable.multi == True: + if variable.multi is True and variable.path not in self.objectspace.multis: self.objectspace.multis[variable.path] = True def _convert_variable( -- 2.45.0 From 69d590d205096ff6ce4ce86664eecfff7bc70d5f Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 18 Jun 2024 18:01:28 +0200 Subject: [PATCH 09/10] imports of CONVERT_OPTION in the tests --- tests/dictionaries/20family_dynamic/tiramisu/base.py | 2 +- tests/dictionaries/20family_dynamic/tiramisu/multi.py | 2 +- tests/dictionaries/20family_dynamic_1.1/tiramisu/base.py | 2 +- tests/dictionaries/20family_dynamic_1.1/tiramisu/multi.py | 2 +- .../dictionaries/20family_dynamic_description/tiramisu/base.py | 2 +- .../dictionaries/20family_dynamic_description/tiramisu/multi.py | 2 +- tests/dictionaries/20family_dynamic_jinja/tiramisu/base.py | 2 +- tests/dictionaries/20family_dynamic_jinja/tiramisu/multi.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/dictionaries/20family_dynamic/tiramisu/base.py b/tests/dictionaries/20family_dynamic/tiramisu/base.py index 0f81ded40..ee2309b43 100644 --- a/tests/dictionaries/20family_dynamic/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic/tiramisu/multi.py b/tests/dictionaries/20family_dynamic/tiramisu/multi.py index 0342b0d1a..c8edc428d 100644 --- a/tests/dictionaries/20family_dynamic/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_1.1/tiramisu/base.py b/tests/dictionaries/20family_dynamic_1.1/tiramisu/base.py index 0f81ded40..ee2309b43 100644 --- a/tests/dictionaries/20family_dynamic_1.1/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_1.1/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_1.1/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_1.1/tiramisu/multi.py index 0342b0d1a..c8edc428d 100644 --- a/tests/dictionaries/20family_dynamic_1.1/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_1.1/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_description/tiramisu/base.py b/tests/dictionaries/20family_dynamic_description/tiramisu/base.py index 0d7a99750..2f78230f1 100644 --- a/tests/dictionaries/20family_dynamic_description/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_description/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py index c3b3eb761..449074fbc 100644 --- a/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja/tiramisu/base.py index a5651b54c..6069905fb 100644 --- a/tests/dictionaries/20family_dynamic_jinja/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_jinja/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja/tiramisu/multi.py index 1df72d1ba..1f80e96d7 100644 --- a/tests/dictionaries/20family_dynamic_jinja/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_jinja/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION -- 2.45.0 From d4e80197cae6c6d19d69110fd6333d579b441d33 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 19 Jun 2024 15:29:43 +0200 Subject: [PATCH 10/10] refactor + test --- src/rougail/annotator/value.py | 46 ++++++--------- src/rougail/annotator/variable.py | 59 ++++++++++--------- src/rougail/object_model.py | 2 +- src/rougail/tiramisureflector.py | 4 +- .../dictionaries/01base_auto_bool/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 4 ++ .../01base_auto_bool/makedict/after.json | 6 ++ .../01base_auto_bool/makedict/base.json | 3 + .../01base_auto_bool/makedict/before.json | 6 ++ .../01base_auto_bool/makedict/mandatory.json | 1 + .../01base_auto_bool/tiramisu/base.py | 24 ++++++++ .../01base_auto_bool/tiramisu/multi.py | 28 +++++++++ .../01base_auto_bool_multi/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 5 ++ .../makedict/after.json | 6 ++ .../01base_auto_bool_multi/makedict/base.json | 3 + .../makedict/before.json | 6 ++ .../makedict/mandatory.json | 1 + .../01base_auto_bool_multi/tiramisu/base.py | 24 ++++++++ .../01base_auto_bool_multi/tiramisu/multi.py | 28 +++++++++ .../01base_auto_float/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 4 ++ .../01base_auto_float/makedict/after.json | 6 ++ .../01base_auto_float/makedict/base.json | 3 + .../01base_auto_float/makedict/before.json | 6 ++ .../01base_auto_float/makedict/mandatory.json | 1 + .../01base_auto_float/tiramisu/base.py | 24 ++++++++ .../01base_auto_float/tiramisu/multi.py | 28 +++++++++ .../01base_auto_float_multi/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 5 ++ .../makedict/after.json | 6 ++ .../makedict/base.json | 3 + .../makedict/before.json | 6 ++ .../makedict/mandatory.json | 1 + .../01base_auto_float_multi/tiramisu/base.py | 24 ++++++++ .../01base_auto_float_multi/tiramisu/multi.py | 28 +++++++++ .../01base_auto_number/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 4 ++ .../01base_auto_number/makedict/after.json | 6 ++ .../01base_auto_number/makedict/base.json | 3 + .../01base_auto_number/makedict/before.json | 6 ++ .../makedict/mandatory.json | 1 + .../01base_auto_number/tiramisu/base.py | 24 ++++++++ .../01base_auto_number/tiramisu/multi.py | 28 +++++++++ .../01base_auto_number_multi/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 5 ++ .../makedict/after.json | 6 ++ .../makedict/base.json | 3 + .../makedict/before.json | 6 ++ .../makedict/mandatory.json | 1 + .../01base_auto_number_multi/tiramisu/base.py | 24 ++++++++ .../tiramisu/multi.py | 28 +++++++++ .../01base_custom/makedict/mandatory.json | 1 + .../01base_multi_auto/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 6 ++ .../01base_multi_auto/makedict/after.json | 8 +++ .../01base_multi_auto/makedict/base.json | 5 ++ .../01base_multi_auto/makedict/before.json | 8 +++ .../01base_multi_auto/makedict/mandatory.json | 1 + .../01base_multi_auto/tiramisu/base.py | 25 ++++++++ .../01base_multi_auto/tiramisu/multi.py | 30 ++++++++++ .../dictionaries/rougail/00-base.yml | 3 +- .../__init__.py | 0 .../dictionaries/rougail/00-base.yml | 11 ++++ .../makedict/after.json | 6 ++ .../makedict/base.json | 3 + .../makedict/before.json | 6 ++ .../makedict/mandatory.json | 1 + .../tiramisu/base.py | 28 +++++++++ .../tiramisu/multi.py | 36 +++++++++++ .../__init__.py | 0 .../dictionaries/rougail/00-base.yml | 15 +++++ .../makedict/after.json | 29 +++++++++ .../makedict/base.json | 14 +++++ .../makedict/before.json | 29 +++++++++ .../makedict/mandatory.json | 1 + .../tiramisu/base.py | 28 +++++++++ .../tiramisu/multi.py | 36 +++++++++++ .../10valid_enum_auto/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 8 +++ .../10valid_enum_auto/makedict/after.json | 6 ++ .../10valid_enum_auto/makedict/base.json | 3 + .../10valid_enum_auto/makedict/before.json | 6 ++ .../10valid_enum_auto/makedict/mandatory.json | 1 + .../10valid_enum_auto/tiramisu/base.py | 24 ++++++++ .../10valid_enum_auto/tiramisu/multi.py | 28 +++++++++ .../makedict/mandatory.json | 1 + .../dictionaries/rougail/00-base.yml | 1 - .../makedict/mandatory.json | 1 + .../tiramisu/base.py | 2 +- .../tiramisu/multi.py | 2 +- .../tiramisu/base.py | 2 +- .../tiramisu/multi.py | 2 +- .../tiramisu/base.py | 2 +- .../tiramisu/multi.py | 2 +- .../tiramisu/base.py | 2 +- .../tiramisu/multi.py | 2 +- .../dictionaries/rougail/00-base.yml | 3 +- .../dictionaries/61extra_dyn/tiramisu/base.py | 2 +- .../61extra_dyn/tiramisu/multi.py | 2 +- .../61extra_dyn_extra/tiramisu/base.py | 2 +- .../61extra_dyn_extra/tiramisu/multi.py | 2 +- .../dictionaries/rougail/00-base.yml | 21 ++----- 103 files changed, 915 insertions(+), 88 deletions(-) create mode 100644 tests/dictionaries/01base_auto_bool/__init__.py create mode 100644 tests/dictionaries/01base_auto_bool/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_auto_bool/makedict/after.json create mode 100644 tests/dictionaries/01base_auto_bool/makedict/base.json create mode 100644 tests/dictionaries/01base_auto_bool/makedict/before.json create mode 100644 tests/dictionaries/01base_auto_bool/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_auto_bool/tiramisu/base.py create mode 100644 tests/dictionaries/01base_auto_bool/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_auto_bool_multi/__init__.py create mode 100644 tests/dictionaries/01base_auto_bool_multi/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_auto_bool_multi/makedict/after.json create mode 100644 tests/dictionaries/01base_auto_bool_multi/makedict/base.json create mode 100644 tests/dictionaries/01base_auto_bool_multi/makedict/before.json create mode 100644 tests/dictionaries/01base_auto_bool_multi/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_auto_bool_multi/tiramisu/base.py create mode 100644 tests/dictionaries/01base_auto_bool_multi/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_auto_float/__init__.py create mode 100644 tests/dictionaries/01base_auto_float/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_auto_float/makedict/after.json create mode 100644 tests/dictionaries/01base_auto_float/makedict/base.json create mode 100644 tests/dictionaries/01base_auto_float/makedict/before.json create mode 100644 tests/dictionaries/01base_auto_float/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_auto_float/tiramisu/base.py create mode 100644 tests/dictionaries/01base_auto_float/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_auto_float_multi/__init__.py create mode 100644 tests/dictionaries/01base_auto_float_multi/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_auto_float_multi/makedict/after.json create mode 100644 tests/dictionaries/01base_auto_float_multi/makedict/base.json create mode 100644 tests/dictionaries/01base_auto_float_multi/makedict/before.json create mode 100644 tests/dictionaries/01base_auto_float_multi/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_auto_float_multi/tiramisu/base.py create mode 100644 tests/dictionaries/01base_auto_float_multi/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_auto_number/__init__.py create mode 100644 tests/dictionaries/01base_auto_number/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_auto_number/makedict/after.json create mode 100644 tests/dictionaries/01base_auto_number/makedict/base.json create mode 100644 tests/dictionaries/01base_auto_number/makedict/before.json create mode 100644 tests/dictionaries/01base_auto_number/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_auto_number/tiramisu/base.py create mode 100644 tests/dictionaries/01base_auto_number/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_auto_number_multi/__init__.py create mode 100644 tests/dictionaries/01base_auto_number_multi/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_auto_number_multi/makedict/after.json create mode 100644 tests/dictionaries/01base_auto_number_multi/makedict/base.json create mode 100644 tests/dictionaries/01base_auto_number_multi/makedict/before.json create mode 100644 tests/dictionaries/01base_auto_number_multi/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_auto_number_multi/tiramisu/base.py create mode 100644 tests/dictionaries/01base_auto_number_multi/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_custom/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_multi_auto/__init__.py create mode 100644 tests/dictionaries/01base_multi_auto/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_multi_auto/makedict/after.json create mode 100644 tests/dictionaries/01base_multi_auto/makedict/base.json create mode 100644 tests/dictionaries/01base_multi_auto/makedict/before.json create mode 100644 tests/dictionaries/01base_multi_auto/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_multi_auto/tiramisu/base.py create mode 100644 tests/dictionaries/01base_multi_auto/tiramisu/multi.py create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/__init__.py create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/makedict/after.json create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/makedict/base.json create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/makedict/before.json create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/makedict/mandatory.json create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/base.py create mode 100644 tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/multi.py create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/__init__.py create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/makedict/after.json create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/makedict/base.json create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/makedict/before.json create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/makedict/mandatory.json create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/base.py create mode 100644 tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/multi.py create mode 100644 tests/dictionaries/10valid_enum_auto/__init__.py create mode 100644 tests/dictionaries/10valid_enum_auto/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/10valid_enum_auto/makedict/after.json create mode 100644 tests/dictionaries/10valid_enum_auto/makedict/base.json create mode 100644 tests/dictionaries/10valid_enum_auto/makedict/before.json create mode 100644 tests/dictionaries/10valid_enum_auto/makedict/mandatory.json create mode 100644 tests/dictionaries/10valid_enum_auto/tiramisu/base.py create mode 100644 tests/dictionaries/10valid_enum_auto/tiramisu/multi.py create mode 100644 tests/dictionaries/20family_dynamic_1.1/makedict/mandatory.json create mode 100644 tests/dictionaries/20family_dynamic_jinja/makedict/mandatory.json diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index a3981087b..cef0a00c8 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -66,46 +66,34 @@ class Annotator(Walk): # pylint: disable=R0903 if variable.type == "boolean" and multi is False and variable.default is None: variable.default = True - if variable.default is None: + if variable.default is None or isinstance(variable.default, Calculation): return - has_value = False - if isinstance(variable.default, Calculation): - pass - # variable.default = variable.default.to_function(self.functions) - elif isinstance(variable.default, list): - if not multi and variable.version == "1.0": - raise Exception( - f'The variable "{variable.path}" with a list as default value must have "multi" attribute' + + if isinstance(variable.default, list): + if not multi: + msg = f'The variable "{variable.path}" with a list as default value must have "multi" attribute' + raise DictConsistencyError(msg, 68, variable.xmlfiles) + if variable.path in self.objectspace.followers and multi != "submulti": + msg = _( + f'the follower "{variable.name}" without multi attribute can only have one value' ) - if variable.path in self.objectspace.followers: - if multi != "submulti" and len(variable.default) != 1: - msg = _( - f'the follower "{variable.name}" without multi attribute can only have one value' - ) - raise DictConsistencyError(msg, 87, variable.xmlfiles) - # else: - # variable.default = [value.name for value in variable.default] + raise DictConsistencyError(msg, 87, variable.xmlfiles) if variable.path not in self.objectspace.leaders: if multi == "submulti": self.objectspace.default_multi[ variable.path - ] = variable.default # [value.name for value in variable.value] + ] = variable.default variable.default = None else: self.objectspace.default_multi[variable.path] = variable.default[ 0 - ] # .name - has_value = True + ] elif variable.multi: - # msg = _(f'the none multi variable "{variable.name}" cannot have ' - # 'more than one value') - # raise DictConsistencyError(msg, 68, variable.xmlfiles) - raise Exception("pfff") - else: - if variable.path in self.objectspace.followers: - self.objectspace.default_multi[variable.path] = variable.default - variable.default = None - has_value = True + msg = _(f'the variable "{variable.name}" is multi but has a non list default value') + raise DictConsistencyError(msg, 12, variable.xmlfiles) + elif variable.path in self.objectspace.followers: + self.objectspace.default_multi[variable.path] = variable.default + variable.default = None def add_choice_nil(self) -> None: """A variable with type "Choice" that is not mandatory must has "nil" value""" diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index c9cb8ecc9..40b8cc001 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -70,45 +70,47 @@ class Annotator(Walk): # pylint: disable=R0903 ] for extra in self.objectspace.rougailconfig["extra_dictionaries"]: self.forbidden_name.append(extra) + # default type inference from a default value with :term:`basic types` + self.basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} self.convert_variable() self.convert_test() self.convert_help() def convert_variable(self): """convert variable""" - # default type inference from a default value with :term:`basic types` - basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} - for variable in self.get_variables(): if variable.type == "symlink": continue - # choice type inference from the `choices` attribute if variable.version != "1.0": - if variable.choices is not None: - if variable.type is None: - variable.type = "choice" + self._convert_variable_inference(variable) + if variable.multi is None: + variable.multi = False + if variable.type is None: + variable.type = "string" self._convert_variable(variable) - multi = self.objectspace.multis.get(variable.path, False) - if variable.version == "1.0": - # - version: 1.0, the default value is of type "string" by default - if variable.type is None: - variable.type = "string" - else: #if variable.version != "1.0": - # - version: 1.1, the default value has no type by default - if multi is False and variable.type is None: - if type(variable.default) in basic_types: - variable.type = basic_types[type(variable.default)] - elif isinstance(variable.default, list): - if variable.multi is None or variable.multi is False: - variable.multi = True - if variable.type is None: - variable.type = basic_types[type(variable.default[0])] - #else: - # variable.type = "string" - # let's update the "multi" attribute in the tiramisu cache then - if variable.multi is True and variable.path not in self.objectspace.multis: - self.objectspace.multis[variable.path] = True + def _convert_variable_inference( + self, + variable, + ) -> None: + + # variable has no type + if variable.type is None: + # choice type inference from the `choices` attribute + if variable.choices is not None: + variable.type = "choice" + elif variable.default not in [None, []]: + if isinstance(variable.default, list): + tested_value = variable.default[0] + else: + tested_value = variable.default + variable.type = self.basic_types.get(type(tested_value), None) + # variable has no multi attribute + if variable.multi is None: + if variable.path in self.objectspace.leaders: + variable.multi = True + else: + variable.multi = isinstance(variable.default, list) def _convert_variable( self, @@ -134,6 +136,9 @@ class Annotator(Walk): # pylint: disable=R0903 elif family.hidden: variable.hidden = family.hidden variable.hidden = None + if variable.choices is not None and variable.type != 'choice': + msg = _(f'the variable "{variable.path}" has choice attribut but has not the "choice" type') + raise DictConsistencyError(msg, 11, variable.xmlfiles) def convert_test(self): """Convert variable tests value""" diff --git a/src/rougail/object_model.py b/src/rougail/object_model.py index cf4776830..a5b43d6cb 100644 --- a/src/rougail/object_model.py +++ b/src/rougail/object_model.py @@ -428,7 +428,7 @@ class Variable(BaseModel): default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None params: Optional[List[Param]] = None validators: Optional[List[Calculation]] = None - multi: bool = False + multi: Optional[bool] = None unique: Optional[bool] = None help: Optional[str] = None hidden: Union[bool, Calculation] = False diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index a03de68f3..0cfb38807 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -513,8 +513,10 @@ class Variable(Common): for idx, val in enumerate(value): if isinstance(val, Calculation): value[idx] = self.calculation_value(val) - else: + elif isinstance(val, str): value[idx] = self.convert_str(val) + else: + value[idx] = str(val) value = "[" + ", ".join(value) + "]" keys["default"] = value if self.elt.path in self.objectspace.default_multi: diff --git a/tests/dictionaries/01base_auto_bool/__init__.py b/tests/dictionaries/01base_auto_bool/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_auto_bool/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_auto_bool/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..9233af433 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/dictionaries/rougail/00-base.yml @@ -0,0 +1,4 @@ +--- +version: '1.1' +auto: + default: true diff --git a/tests/dictionaries/01base_auto_bool/makedict/after.json b/tests/dictionaries/01base_auto_bool/makedict/after.json new file mode 100644 index 000000000..21399b3e3 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/01base_auto_bool/makedict/base.json b/tests/dictionaries/01base_auto_bool/makedict/base.json new file mode 100644 index 000000000..a8a77f69e --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.auto": true +} diff --git a/tests/dictionaries/01base_auto_bool/makedict/before.json b/tests/dictionaries/01base_auto_bool/makedict/before.json new file mode 100644 index 000000000..21399b3e3 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/01base_auto_bool/makedict/mandatory.json b/tests/dictionaries/01base_auto_bool/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/01base_auto_bool/tiramisu/base.py b/tests/dictionaries/01base_auto_bool/tiramisu/base.py new file mode 100644 index 000000000..bebe3acdd --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = BoolOption(name="auto", doc="auto", default=True, properties=frozenset({"mandatory", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_auto_bool/tiramisu/multi.py b/tests/dictionaries/01base_auto_bool/tiramisu/multi.py new file mode 100644 index 000000000..007cafed4 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = BoolOption(name="auto", doc="auto", default=True, properties=frozenset({"mandatory", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = BoolOption(name="auto", doc="auto", default=True, properties=frozenset({"mandatory", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/01base_auto_bool_multi/__init__.py b/tests/dictionaries/01base_auto_bool_multi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_auto_bool_multi/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_auto_bool_multi/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..2fcf8a880 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/dictionaries/rougail/00-base.yml @@ -0,0 +1,5 @@ +--- +version: '1.1' +auto: + default: + - true diff --git a/tests/dictionaries/01base_auto_bool_multi/makedict/after.json b/tests/dictionaries/01base_auto_bool_multi/makedict/after.json new file mode 100644 index 000000000..7f0d73b06 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": [true] + } +} diff --git a/tests/dictionaries/01base_auto_bool_multi/makedict/base.json b/tests/dictionaries/01base_auto_bool_multi/makedict/base.json new file mode 100644 index 000000000..ac9330294 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.auto": [true] +} diff --git a/tests/dictionaries/01base_auto_bool_multi/makedict/before.json b/tests/dictionaries/01base_auto_bool_multi/makedict/before.json new file mode 100644 index 000000000..7f0d73b06 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": [true] + } +} diff --git a/tests/dictionaries/01base_auto_bool_multi/makedict/mandatory.json b/tests/dictionaries/01base_auto_bool_multi/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/01base_auto_bool_multi/tiramisu/base.py b/tests/dictionaries/01base_auto_bool_multi/tiramisu/base.py new file mode 100644 index 000000000..a088674ba --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = BoolOption(name="auto", doc="auto", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_auto_bool_multi/tiramisu/multi.py b/tests/dictionaries/01base_auto_bool_multi/tiramisu/multi.py new file mode 100644 index 000000000..4446e7ff1 --- /dev/null +++ b/tests/dictionaries/01base_auto_bool_multi/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = BoolOption(name="auto", doc="auto", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = BoolOption(name="auto", doc="auto", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/01base_auto_float/__init__.py b/tests/dictionaries/01base_auto_float/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_auto_float/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_auto_float/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..0ffb4eb02 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/dictionaries/rougail/00-base.yml @@ -0,0 +1,4 @@ +--- +version: '1.1' +auto: + default: 1.0 diff --git a/tests/dictionaries/01base_auto_float/makedict/after.json b/tests/dictionaries/01base_auto_float/makedict/after.json new file mode 100644 index 000000000..accf30153 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": 1.0 + } +} diff --git a/tests/dictionaries/01base_auto_float/makedict/base.json b/tests/dictionaries/01base_auto_float/makedict/base.json new file mode 100644 index 000000000..da46848f6 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.auto": 1.0 +} diff --git a/tests/dictionaries/01base_auto_float/makedict/before.json b/tests/dictionaries/01base_auto_float/makedict/before.json new file mode 100644 index 000000000..accf30153 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": 1.0 + } +} diff --git a/tests/dictionaries/01base_auto_float/makedict/mandatory.json b/tests/dictionaries/01base_auto_float/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/01base_auto_float/tiramisu/base.py b/tests/dictionaries/01base_auto_float/tiramisu/base.py new file mode 100644 index 000000000..02e36b339 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = FloatOption(name="auto", doc="auto", default=1.0, properties=frozenset({"mandatory", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_auto_float/tiramisu/multi.py b/tests/dictionaries/01base_auto_float/tiramisu/multi.py new file mode 100644 index 000000000..3c22b0db7 --- /dev/null +++ b/tests/dictionaries/01base_auto_float/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = FloatOption(name="auto", doc="auto", default=1.0, properties=frozenset({"mandatory", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = FloatOption(name="auto", doc="auto", default=1.0, properties=frozenset({"mandatory", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/01base_auto_float_multi/__init__.py b/tests/dictionaries/01base_auto_float_multi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_auto_float_multi/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_auto_float_multi/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..63148f08d --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/dictionaries/rougail/00-base.yml @@ -0,0 +1,5 @@ +--- +version: '1.1' +auto: + default: + - 1.0 diff --git a/tests/dictionaries/01base_auto_float_multi/makedict/after.json b/tests/dictionaries/01base_auto_float_multi/makedict/after.json new file mode 100644 index 000000000..019ece384 --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": [1.0] + } +} diff --git a/tests/dictionaries/01base_auto_float_multi/makedict/base.json b/tests/dictionaries/01base_auto_float_multi/makedict/base.json new file mode 100644 index 000000000..b129ea0e9 --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.auto": [1.0] +} diff --git a/tests/dictionaries/01base_auto_float_multi/makedict/before.json b/tests/dictionaries/01base_auto_float_multi/makedict/before.json new file mode 100644 index 000000000..019ece384 --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": [1.0] + } +} diff --git a/tests/dictionaries/01base_auto_float_multi/makedict/mandatory.json b/tests/dictionaries/01base_auto_float_multi/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/01base_auto_float_multi/tiramisu/base.py b/tests/dictionaries/01base_auto_float_multi/tiramisu/base.py new file mode 100644 index 000000000..546031009 --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = FloatOption(name="auto", doc="auto", multi=True, default=[1.0], default_multi=1.0, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_auto_float_multi/tiramisu/multi.py b/tests/dictionaries/01base_auto_float_multi/tiramisu/multi.py new file mode 100644 index 000000000..0dd08f839 --- /dev/null +++ b/tests/dictionaries/01base_auto_float_multi/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = FloatOption(name="auto", doc="auto", multi=True, default=[1.0], default_multi=1.0, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = FloatOption(name="auto", doc="auto", multi=True, default=[1.0], default_multi=1.0, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/01base_auto_number/__init__.py b/tests/dictionaries/01base_auto_number/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_auto_number/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_auto_number/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..eaea92323 --- /dev/null +++ b/tests/dictionaries/01base_auto_number/dictionaries/rougail/00-base.yml @@ -0,0 +1,4 @@ +--- +version: '1.1' +auto: + default: 1 diff --git a/tests/dictionaries/01base_auto_number/makedict/after.json b/tests/dictionaries/01base_auto_number/makedict/after.json new file mode 100644 index 000000000..61614a5bd --- /dev/null +++ b/tests/dictionaries/01base_auto_number/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": 1 + } +} diff --git a/tests/dictionaries/01base_auto_number/makedict/base.json b/tests/dictionaries/01base_auto_number/makedict/base.json new file mode 100644 index 000000000..4dee012e5 --- /dev/null +++ b/tests/dictionaries/01base_auto_number/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.auto": 1 +} diff --git a/tests/dictionaries/01base_auto_number/makedict/before.json b/tests/dictionaries/01base_auto_number/makedict/before.json new file mode 100644 index 000000000..61614a5bd --- /dev/null +++ b/tests/dictionaries/01base_auto_number/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": 1 + } +} diff --git a/tests/dictionaries/01base_auto_number/makedict/mandatory.json b/tests/dictionaries/01base_auto_number/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/01base_auto_number/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/01base_auto_number/tiramisu/base.py b/tests/dictionaries/01base_auto_number/tiramisu/base.py new file mode 100644 index 000000000..45053cbca --- /dev/null +++ b/tests/dictionaries/01base_auto_number/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = IntOption(name="auto", doc="auto", default=1, properties=frozenset({"mandatory", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_auto_number/tiramisu/multi.py b/tests/dictionaries/01base_auto_number/tiramisu/multi.py new file mode 100644 index 000000000..f8bb6c021 --- /dev/null +++ b/tests/dictionaries/01base_auto_number/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = IntOption(name="auto", doc="auto", default=1, properties=frozenset({"mandatory", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = IntOption(name="auto", doc="auto", default=1, properties=frozenset({"mandatory", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/01base_auto_number_multi/__init__.py b/tests/dictionaries/01base_auto_number_multi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_auto_number_multi/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_auto_number_multi/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..9f1dedfa8 --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/dictionaries/rougail/00-base.yml @@ -0,0 +1,5 @@ +--- +version: '1.1' +auto: + default: + - 1 diff --git a/tests/dictionaries/01base_auto_number_multi/makedict/after.json b/tests/dictionaries/01base_auto_number_multi/makedict/after.json new file mode 100644 index 000000000..8ef14c6a0 --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": [1] + } +} diff --git a/tests/dictionaries/01base_auto_number_multi/makedict/base.json b/tests/dictionaries/01base_auto_number_multi/makedict/base.json new file mode 100644 index 000000000..c710bc45c --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.auto": [1] +} diff --git a/tests/dictionaries/01base_auto_number_multi/makedict/before.json b/tests/dictionaries/01base_auto_number_multi/makedict/before.json new file mode 100644 index 000000000..8ef14c6a0 --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.auto": { + "owner": "default", + "value": [1] + } +} diff --git a/tests/dictionaries/01base_auto_number_multi/makedict/mandatory.json b/tests/dictionaries/01base_auto_number_multi/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/01base_auto_number_multi/tiramisu/base.py b/tests/dictionaries/01base_auto_number_multi/tiramisu/base.py new file mode 100644 index 000000000..607722f39 --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = IntOption(name="auto", doc="auto", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_auto_number_multi/tiramisu/multi.py b/tests/dictionaries/01base_auto_number_multi/tiramisu/multi.py new file mode 100644 index 000000000..2ef6e5067 --- /dev/null +++ b/tests/dictionaries/01base_auto_number_multi/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = IntOption(name="auto", doc="auto", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = IntOption(name="auto", doc="auto", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/01base_custom/makedict/mandatory.json b/tests/dictionaries/01base_custom/makedict/mandatory.json new file mode 100644 index 000000000..ce7fcf3a6 --- /dev/null +++ b/tests/dictionaries/01base_custom/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.custom"] \ No newline at end of file diff --git a/tests/dictionaries/01base_multi_auto/__init__.py b/tests/dictionaries/01base_multi_auto/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_multi_auto/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_multi_auto/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..9fc31df2d --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/dictionaries/rougail/00-base.yml @@ -0,0 +1,6 @@ +--- +version: '1.1' +general: + mode_conteneur_actif: + default: + - non diff --git a/tests/dictionaries/01base_multi_auto/makedict/after.json b/tests/dictionaries/01base_multi_auto/makedict/after.json new file mode 100644 index 000000000..cfec4b1fc --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/makedict/after.json @@ -0,0 +1,8 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": [ + "non" + ] + } +} diff --git a/tests/dictionaries/01base_multi_auto/makedict/base.json b/tests/dictionaries/01base_multi_auto/makedict/base.json new file mode 100644 index 000000000..feedadc62 --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/makedict/base.json @@ -0,0 +1,5 @@ +{ + "rougail.general.mode_conteneur_actif": [ + "non" + ] +} diff --git a/tests/dictionaries/01base_multi_auto/makedict/before.json b/tests/dictionaries/01base_multi_auto/makedict/before.json new file mode 100644 index 000000000..cfec4b1fc --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/makedict/before.json @@ -0,0 +1,8 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": [ + "non" + ] + } +} diff --git a/tests/dictionaries/01base_multi_auto/makedict/mandatory.json b/tests/dictionaries/01base_multi_auto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_multi_auto/tiramisu/base.py b/tests/dictionaries/01base_multi_auto/tiramisu/base.py new file mode 100644 index 000000000..62e9b675b --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/tiramisu/base.py @@ -0,0 +1,25 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", multi=True, default=["non"], default_multi="non", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_multi_auto/tiramisu/multi.py b/tests/dictionaries/01base_multi_auto/tiramisu/multi.py new file mode 100644 index 000000000..7b1b88f26 --- /dev/null +++ b/tests/dictionaries/01base_multi_auto/tiramisu/multi.py @@ -0,0 +1,30 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", multi=True, default=["non"], default_multi="non", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_8 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", multi=True, default=["non"], default_multi="non", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8], properties=frozenset({"standard"})) +optiondescription_6 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_7], properties=frozenset({"standard"})) +optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5]) diff --git a/tests/dictionaries/01test_multi/dictionaries/rougail/00-base.yml b/tests/dictionaries/01test_multi/dictionaries/rougail/00-base.yml index c183b6f31..92438b71e 100644 --- a/tests/dictionaries/01test_multi/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/01test_multi/dictionaries/rougail/00-base.yml @@ -1,7 +1,8 @@ +--- +version: '1.0' general: mode_conteneur_actif: test: - test1 - test2 default: non -version: '1.0' diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/__init__.py b/tests/dictionaries/10load_leadership_default_multi_auto/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/dictionaries/rougail/00-base.yml b/tests/dictionaries/10load_leadership_default_multi_auto/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..ed2a89954 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/dictionaries/rougail/00-base.yml @@ -0,0 +1,11 @@ +--- +version: '1.1' +general: + leader: + type: leadership + leader: + mandatory: false + follower1: + default: value + follower2: + mandatory: false diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/makedict/after.json b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/after.json new file mode 100644 index 000000000..fe99b1e57 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.general.leader.leader": { + "owner": "default", + "value": [] + } +} diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/makedict/base.json b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/base.json new file mode 100644 index 000000000..265e8efd4 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.general.leader.leader": [] +} diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/makedict/before.json b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/before.json new file mode 100644 index 000000000..fe99b1e57 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.general.leader.leader": { + "owner": "default", + "value": [] + } +} diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/makedict/mandatory.json b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/mandatory.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/base.py b/tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/base.py new file mode 100644 index 000000000..6e4fd6a5e --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/base.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_4 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"standard"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "standard"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"standard"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[optiondescription_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/multi.py b/tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/multi.py new file mode 100644 index 000000000..e43c1145d --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi_auto/tiramisu/multi.py @@ -0,0 +1,36 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"standard"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "standard"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"standard"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"standard"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[optiondescription_4], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"standard"})) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "standard"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"standard"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"standard"})) +optiondescription_10 = OptionDescription(name="general", doc="general", children=[optiondescription_11], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_10], properties=frozenset({"standard"})) +optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8]) diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/__init__.py b/tests/dictionaries/10load_leadership_default_submulti_auto/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/dictionaries/rougail/00-base.yml b/tests/dictionaries/10load_leadership_default_submulti_auto/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..139bc9a87 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/dictionaries/rougail/00-base.yml @@ -0,0 +1,15 @@ +--- +version: '1.1' +general: + leader: + type: leadership + leader: + default: + - leader + follower1: + default: + - value + follower2: + default: + - value1 + - value2 diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/after.json b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/after.json new file mode 100644 index 000000000..67600412d --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/after.json @@ -0,0 +1,29 @@ +{ + "rougail.general.leader.leader": { + "owner": "default", + "value": [ + "leader" + ] + }, + "rougail.general.leader.follower1": { + "owner": [ + "default" + ], + "value": [ + [ + "value" + ] + ] + }, + "rougail.general.leader.follower2": { + "owner": [ + "default" + ], + "value": [ + [ + "value1", + "value2" + ] + ] + } +} diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/base.json b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/base.json new file mode 100644 index 000000000..5082c8ff0 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/base.json @@ -0,0 +1,14 @@ +{ + "rougail.general.leader.leader": [ + { + "rougail.general.leader.leader": "leader", + "rougail.general.leader.follower1": [ + "value" + ], + "rougail.general.leader.follower2": [ + "value1", + "value2" + ] + } + ] +} diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/before.json b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/before.json new file mode 100644 index 000000000..67600412d --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/before.json @@ -0,0 +1,29 @@ +{ + "rougail.general.leader.leader": { + "owner": "default", + "value": [ + "leader" + ] + }, + "rougail.general.leader.follower1": { + "owner": [ + "default" + ], + "value": [ + [ + "value" + ] + ] + }, + "rougail.general.leader.follower2": { + "owner": [ + "default" + ], + "value": [ + [ + "value1", + "value2" + ] + ] + } +} diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/mandatory.json b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/base.py b/tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/base.py new file mode 100644 index 000000000..77051bdba --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/base.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_4 = StrOption(name="leader", doc="leader", multi=True, default=["leader"], properties=frozenset({"mandatory", "notempty", "standard"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "notempty", "standard"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[optiondescription_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/multi.py b/tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/multi.py new file mode 100644 index 000000000..a7224b7bd --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti_auto/tiramisu/multi.py @@ -0,0 +1,36 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_5 = StrOption(name="leader", doc="leader", multi=True, default=["leader"], properties=frozenset({"mandatory", "notempty", "standard"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "notempty", "standard"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"standard"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[optiondescription_4], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, default=["leader"], properties=frozenset({"mandatory", "notempty", "standard"})) +option_13 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "notempty", "standard"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"standard"})) +optiondescription_10 = OptionDescription(name="general", doc="general", children=[optiondescription_11], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_10], properties=frozenset({"standard"})) +optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8]) diff --git a/tests/dictionaries/10valid_enum_auto/__init__.py b/tests/dictionaries/10valid_enum_auto/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/10valid_enum_auto/dictionaries/rougail/00-base.yml b/tests/dictionaries/10valid_enum_auto/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..ae8b3f188 --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/dictionaries/rougail/00-base.yml @@ -0,0 +1,8 @@ +--- +version: '1.1' +enumvar: + default: c + choices: + - a + - b + - c diff --git a/tests/dictionaries/10valid_enum_auto/makedict/after.json b/tests/dictionaries/10valid_enum_auto/makedict/after.json new file mode 100644 index 000000000..e2192813e --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.enumvar": { + "owner": "default", + "value": "c" + } +} diff --git a/tests/dictionaries/10valid_enum_auto/makedict/base.json b/tests/dictionaries/10valid_enum_auto/makedict/base.json new file mode 100644 index 000000000..d393289dc --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.enumvar": "c" +} diff --git a/tests/dictionaries/10valid_enum_auto/makedict/before.json b/tests/dictionaries/10valid_enum_auto/makedict/before.json new file mode 100644 index 000000000..e2192813e --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.enumvar": { + "owner": "default", + "value": "c" + } +} diff --git a/tests/dictionaries/10valid_enum_auto/makedict/mandatory.json b/tests/dictionaries/10valid_enum_auto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_auto/tiramisu/base.py b/tests/dictionaries/10valid_enum_auto/tiramisu/base.py new file mode 100644 index 000000000..8890ec409 --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/tiramisu/base.py @@ -0,0 +1,24 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_2 = ChoiceOption(name="enumvar", doc="enumvar", values=("a", "b", "c"), default="c", properties=frozenset({"mandatory", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/10valid_enum_auto/tiramisu/multi.py b/tests/dictionaries/10valid_enum_auto/tiramisu/multi.py new file mode 100644 index 000000000..6a11b4be5 --- /dev/null +++ b/tests/dictionaries/10valid_enum_auto/tiramisu/multi.py @@ -0,0 +1,28 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +option_3 = ChoiceOption(name="enumvar", doc="enumvar", values=("a", "b", "c"), default="c", properties=frozenset({"mandatory", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_6 = ChoiceOption(name="enumvar", doc="enumvar", values=("a", "b", "c"), default="c", properties=frozenset({"mandatory", "standard"})) +optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"})) +optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/dictionaries/20family_dynamic_1.1/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_1.1/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_1.1/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_jinja/dictionaries/rougail/00-base.yml index f9735e83b..dc81a440d 100644 --- a/tests/dictionaries/20family_dynamic_jinja/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/20family_dynamic_jinja/dictionaries/rougail/00-base.yml @@ -16,7 +16,6 @@ dyn: {% for val in rougail.general.varname %} {{ loop.index }} {% endfor %} - propertyerror: false vardyn: type: string description: No change diff --git a/tests/dictionaries/20family_dynamic_jinja/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_jinja/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py index b448f8944..f9fb71fd6 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py index 4de8a30ea..234199210 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py index 085c829ac..227cb6eab 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py index f6ee48f7b..e2ec32a56 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py index c38e2b46c..a82a88519 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py index 9c3038abf..7cfc6e9b0 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py b/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py index 202befc0b..b16db446f 100644 --- a/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py index ddc6d6468..c3461559c 100644 --- a/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/45multi_family/dictionaries/rougail/00-base.yml b/tests/dictionaries/45multi_family/dictionaries/rougail/00-base.yml index 7a427a7d3..409181ef0 100644 --- a/tests/dictionaries/45multi_family/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/45multi_family/dictionaries/rougail/00-base.yml @@ -1,5 +1,6 @@ +--- +version: '1.0' base: subfamily: variable: mandatory: false -version: '1.0' diff --git a/tests/dictionaries/61extra_dyn/tiramisu/base.py b/tests/dictionaries/61extra_dyn/tiramisu/base.py index 49411e9b8..aad953fcf 100644 --- a/tests/dictionaries/61extra_dyn/tiramisu/base.py +++ b/tests/dictionaries/61extra_dyn/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/61extra_dyn/tiramisu/multi.py b/tests/dictionaries/61extra_dyn/tiramisu/multi.py index 13724fd28..01469001a 100644 --- a/tests/dictionaries/61extra_dyn/tiramisu/multi.py +++ b/tests/dictionaries/61extra_dyn/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py b/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py index 3bed78f5c..80585e1d2 100644 --- a/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py +++ b/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py b/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py index 8f7fd385c..a98874815 100644 --- a/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py +++ b/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py @@ -21,7 +21,7 @@ def _load_functions(path): _load_functions('tests/dictionaries/../eosfunc/test.py') from jinja2 import StrictUndefined, DictLoader from jinja2.sandbox import SandboxedEnvironment -from rougail.annotator.variable import CONVERT_OPTION +from rougail import CONVERT_OPTION from tiramisu.error import ValueWarning def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): global ENV, CONVERT_OPTION diff --git a/tests/dictionaries/80valid_enum_not_choice/dictionaries/rougail/00-base.yml b/tests/dictionaries/80valid_enum_not_choice/dictionaries/rougail/00-base.yml index 0f2283e35..225cef50d 100644 --- a/tests/dictionaries/80valid_enum_not_choice/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/80valid_enum_not_choice/dictionaries/rougail/00-base.yml @@ -1,18 +1,9 @@ -general: - mode: advanced - mode_conteneur_actif: - type: string - description: No change - default: non -enumfam: - mode: advanced - enumvar: - type: string - description: multi - help: bla bla bla - default: c - choices: +--- +version: '1.0' +enumvar: + type: string + default: c + choices: - a - b - c -version: '1.0' -- 2.45.0