From 5668520a31728e7af83f063d596fa7269ba9e5b6 Mon Sep 17 00:00:00 2001 From: "gnunux@silique.fr" Date: Mon, 1 Jul 2024 14:06:59 +0200 Subject: [PATCH] shorthand declaration (#20) Co-authored-by: Emmanuel Garette Co-authored-by: gwen Reviewed-on: https://forge.cloud.silique.fr/stove/rougail/pulls/20 Co-authored-by: gnunux@silique.fr Co-committed-by: gnunux@silique.fr --- docs/family.rst | 17 ++ docs/variable.rst | 168 ++++++++++-------- pyproject.toml | 2 +- src/rougail/annotator/value.py | 23 +-- src/rougail/config.py | 2 - src/rougail/convert.py | 82 ++++++--- src/rougail/update.py | 24 +-- .../01base_bool_shorthand/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 9 + .../01base_bool_shorthand/makedict/after.json | 22 +++ .../01base_bool_shorthand/makedict/base.json | 10 ++ .../makedict/before.json | 22 +++ .../makedict/mandatory.json | 1 + .../01base_bool_shorthand/tiramisu/base.py | 14 ++ .../01base_bool_shorthand/tiramisu/multi.py | 22 +++ .../01base_float_shorthand/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 9 + .../makedict/after.json | 22 +++ .../01base_float_shorthand/makedict/base.json | 10 ++ .../makedict/before.json | 22 +++ .../makedict/mandatory.json | 1 + .../01base_float_shorthand/tiramisu/base.py | 14 ++ .../01base_float_shorthand/tiramisu/multi.py | 22 +++ .../01base_int_shorthand/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 9 + .../01base_int_shorthand/makedict/after.json | 22 +++ .../01base_int_shorthand/makedict/base.json | 10 ++ .../01base_int_shorthand/makedict/before.json | 22 +++ .../makedict/mandatory.json | 1 + .../01base_int_shorthand/tiramisu/base.py | 14 ++ .../01base_int_shorthand/tiramisu/multi.py | 22 +++ .../dictionaries/01base_shorthand/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 15 ++ .../01base_shorthand/makedict/after.json | 33 ++++ .../01base_shorthand/makedict/base.json | 12 ++ .../01base_shorthand/makedict/before.json | 33 ++++ .../01base_shorthand/makedict/mandatory.json | 1 + .../01base_shorthand/tiramisu/base.py | 18 ++ .../01base_shorthand/tiramisu/multi.py | 30 ++++ .../01base_string_shorthand/__init__.py | 0 .../dictionaries/rougail/00-base.yml | 9 + .../makedict/after.json | 22 +++ .../makedict/base.json | 10 ++ .../makedict/before.json | 22 +++ .../makedict/mandatory.json | 1 + .../01base_string_shorthand/tiramisu/base.py | 14 ++ .../01base_string_shorthand/tiramisu/multi.py | 22 +++ .../dictionaries/rougail/00-base.yml | 3 +- .../makedict/after.json | 24 +++ .../makedict/base.json | 9 + .../makedict/before.json | 24 +++ .../makedict/mandatory.json | 1 + .../dictionaries/rougail/00-base.yml | 6 + .../makedict/after.json | 33 ++++ .../makedict/base.json | 12 ++ .../makedict/before.json | 33 ++++ .../makedict/mandatory.json | 1 + .../tiramisu/base.py | 3 +- .../tiramisu/multi.py | 6 +- .../40version_underscode/makedict/after.json | 6 + .../40version_underscode/makedict/base.json | 3 + .../40version_underscode/makedict/before.json | 6 + .../makedict/mandatory.json | 1 + .../51redefine_leadership/makedict/after.json | 6 + .../51redefine_leadership/makedict/base.json | 3 + .../makedict/before.json | 6 + .../makedict/mandatory.json | 1 + .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../01fill_quote/result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/10-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 4 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 4 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/00-base.yml | 10 +- .../result/rougail/00-base.yml | 10 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 7 +- .../result/rougail/01-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 4 +- .../result/rougail/00-base.yml | 4 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/services/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../20override/result/services/00-base.yml | 2 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 10 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 6 +- .../result/rougail/00-base.yml | 14 +- .../result/rougail/01-redefine.yml | 2 +- .../result/rougail/00-base.yml | 4 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 4 +- .../result/extra/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- .../result/rougail/00-base.yml | 2 +- tests/test_1_flattener.py | 4 +- tests/test_2_makedict.py | 2 +- 127 files changed, 1033 insertions(+), 307 deletions(-) create mode 100644 tests/dictionaries/01base_bool_shorthand/__init__.py create mode 100644 tests/dictionaries/01base_bool_shorthand/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_bool_shorthand/makedict/after.json create mode 100644 tests/dictionaries/01base_bool_shorthand/makedict/base.json create mode 100644 tests/dictionaries/01base_bool_shorthand/makedict/before.json create mode 100644 tests/dictionaries/01base_bool_shorthand/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_bool_shorthand/tiramisu/base.py create mode 100644 tests/dictionaries/01base_bool_shorthand/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_float_shorthand/__init__.py create mode 100644 tests/dictionaries/01base_float_shorthand/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_float_shorthand/makedict/after.json create mode 100644 tests/dictionaries/01base_float_shorthand/makedict/base.json create mode 100644 tests/dictionaries/01base_float_shorthand/makedict/before.json create mode 100644 tests/dictionaries/01base_float_shorthand/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_float_shorthand/tiramisu/base.py create mode 100644 tests/dictionaries/01base_float_shorthand/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_int_shorthand/__init__.py create mode 100644 tests/dictionaries/01base_int_shorthand/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_int_shorthand/makedict/after.json create mode 100644 tests/dictionaries/01base_int_shorthand/makedict/base.json create mode 100644 tests/dictionaries/01base_int_shorthand/makedict/before.json create mode 100644 tests/dictionaries/01base_int_shorthand/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_int_shorthand/tiramisu/base.py create mode 100644 tests/dictionaries/01base_int_shorthand/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_shorthand/__init__.py create mode 100644 tests/dictionaries/01base_shorthand/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_shorthand/makedict/after.json create mode 100644 tests/dictionaries/01base_shorthand/makedict/base.json create mode 100644 tests/dictionaries/01base_shorthand/makedict/before.json create mode 100644 tests/dictionaries/01base_shorthand/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_shorthand/tiramisu/base.py create mode 100644 tests/dictionaries/01base_shorthand/tiramisu/multi.py create mode 100644 tests/dictionaries/01base_string_shorthand/__init__.py create mode 100644 tests/dictionaries/01base_string_shorthand/dictionaries/rougail/00-base.yml create mode 100644 tests/dictionaries/01base_string_shorthand/makedict/after.json create mode 100644 tests/dictionaries/01base_string_shorthand/makedict/base.json create mode 100644 tests/dictionaries/01base_string_shorthand/makedict/before.json create mode 100644 tests/dictionaries/01base_string_shorthand/makedict/mandatory.json create mode 100644 tests/dictionaries/01base_string_shorthand/tiramisu/base.py create mode 100644 tests/dictionaries/01base_string_shorthand/tiramisu/multi.py create mode 100644 tests/dictionaries/10leadership_autoleader_expert/makedict/after.json create mode 100644 tests/dictionaries/10leadership_autoleader_expert/makedict/base.json create mode 100644 tests/dictionaries/10leadership_autoleader_expert/makedict/before.json create mode 100644 tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json create mode 100644 tests/dictionaries/20family_dynamic_unknown_suffix/makedict/after.json create mode 100644 tests/dictionaries/20family_dynamic_unknown_suffix/makedict/base.json create mode 100644 tests/dictionaries/20family_dynamic_unknown_suffix/makedict/before.json create mode 100644 tests/dictionaries/20family_dynamic_unknown_suffix/makedict/mandatory.json create mode 100644 tests/dictionaries/40version_underscode/makedict/after.json create mode 100644 tests/dictionaries/40version_underscode/makedict/base.json create mode 100644 tests/dictionaries/40version_underscode/makedict/before.json create mode 100644 tests/dictionaries/40version_underscode/makedict/mandatory.json create mode 100644 tests/dictionaries/51redefine_leadership/makedict/after.json create mode 100644 tests/dictionaries/51redefine_leadership/makedict/base.json create mode 100644 tests/dictionaries/51redefine_leadership/makedict/before.json create mode 100644 tests/dictionaries/51redefine_leadership/makedict/mandatory.json diff --git a/docs/family.rst b/docs/family.rst index d7080f9d0..964a4006e 100644 --- a/docs/family.rst +++ b/docs/family.rst @@ -15,6 +15,23 @@ It is with this name that we will be able to interact with the family. It's best to follow the :ref:`convention on variable names`. +Shorthand declaration +---------------------------- + +Shorthand declaration is a way to declare a family in a single line. But you can only define family name and description. + +To create a family, just add a key with it's name and variables as values. Attention, do not declare any other attributs. + +By default, the description of the variable is the family name. +If you add comment in same line of name, this comment is use as description: + +.. code-block:: yaml + + --- + version: '1.1' + my_family: # This is a great family + variable: + Parameters --------------- diff --git a/docs/variable.rst b/docs/variable.rst index b26e91a69..1eab898dc 100644 --- a/docs/variable.rst +++ b/docs/variable.rst @@ -10,58 +10,80 @@ Synopsis variables A variable is an abstract black box (container) paired with an associated symbolic name, which contains some defined or undefined quantity of data referred to as a `value`. - + .. discussion:: This definition, makes a heavy use of data typing. Indeed, depending on the type system definition of the constistency handling system used, variables may only be able to store a specified data type. - OK, variables are the containers for storing the values. It has something to do with typing. + OK, variables are the containers for storing the values. It has something to do with typing. But this is not just about typing. Name ------------- - + Variable's associated symbolic name. - + It's best to follow the :ref:`convention on variable names`. +Shorthand declaration +---------------------------- + +Shorthand declaration is a way to declare a variable in a single line. But you can only define variable name, description, multi or default value. + +To create a variable, just add a key with it's name and default value as value. +Be careful not to declare any other attributes. + +To declare a multi variable just add a list as default value. + +By default, the description of the variable is the variable name. +If you add a comment in the same line of the name, this comment will be used has a description. + +.. code-block:: yaml + + --- + version: '1.1' + my_variable: 1 # This is a great integer variable + my_multi_variable: # This is a great multi string variable + - value1 + - value2 + Parameters ------------- -.. list-table:: +.. list-table:: :widths: 15 45 :header-rows: 1 - + * - Parameter - Comments - + * - **help** - `string` + `string` - Additional help associated with the variable. - - * - **default** + + * - **default** - Default value(s) of the variable. - + This value is typed, you must correctly fill out the YAML file to avoid defining a value with an incorrect type. For example, a `number` must be a digit type, a multiple variable must be a `list` type, ... - + For a non :term:`leading` multiple variable, the first value defined in the list will also be the default value proposed if a new value is added to this variable. * - **validators** `list` - Value validators. - - Jinja template list. The value of the variable will be considered invalid if the template has a return value. + + Jinja template list. The value of the variable will be considered invalid if the template has a return value. * - **auto_save** - `boolean` + `boolean` - Variable with automatically modified value. - + A variable with automatically modified value is a variable whose value will be considered as *modified* (that is, it is no longer the variable's default value). For example, if the value of this variable comes from a calculation, the value will no longer be recalculated. These variables are usually :term:`required` variables. In fact, these variables are only automatically modified if they have a value. - + A :term:`leader` or :term:`follower` variable cannot have the `auto_save` property. **Default value**: `false` @@ -69,11 +91,11 @@ Parameters `string` - Variable's mode. - + **Default value**: The `default` mode of a variable is the mode of the parent family. Special cases : - + - a variable with an automatically modified value or an automatic read-only variable is by default in `basic` mode - if the variable is not in a family, the variable will have a `standard` mode by default - a :term:`mandatory` variable without default value (calculate or not) will have a `basic` mode @@ -91,19 +113,19 @@ Parameters **Default value**: `false` * - **hidden** - `boolean` or :term:`calculation` + `boolean` or :term:`calculation` - Invisible variable. - + Enables us to *hide* a variable. This means that the variable will no longer be visible in `read-write` mode, but only for calculations or in `read-only` mode. - + When a variable is made invisible, the user will not be able to modify its value; if he has already succeeded in modifying it, this value will not be taken into account. **Default value**: `false` * - **disabled** - `boolean` or :term:`calculation` + `boolean` or :term:`calculation` - Disabled variable. Allows us to deactivate a variable. @@ -113,7 +135,7 @@ Parameters **Default value**: `false`. * - **mandatory** - `boolean` or :term:`calculation` + `boolean` or :term:`calculation` - Mandatory variable. Variable whose value is `required`. @@ -134,74 +156,74 @@ Parameters - creates a variable if it does not exist in another :term:`dictionary` (otherwise do nothing), in this case the value of the attribute must be `true` - in conjunction with the `redefine` attribute set to `true`, only modifies the behavior if it is pre-existing, in which case the attribute's value must be `false`. - + **Default value**: `null` * - **test** `list` - The `test` attribute is a special attribute that allows :term:`dictionary` designers to influence a test robot by specifying useful values to test. - + Concretely, the content of this attribute is recorded in the `information` attribute of the corresponding `Tiramisu` option object. Variables types ---------------- - + A variable **has a type**. This type enables the variable to define the values that are accepted by this variable. -.. list-table:: +.. list-table:: :widths: 15 25 20 15 :header-rows: 1 - + * - Value - Comments - Parameters - Samples - + * - string - character string (default type) - - + - - test - + "1" "true" * - number - - a number + - a number - `min_number`: minimum number allowed - + `max_number`: maximum number allowed - 1 * - float - a floating number - - + - - 1.2 * - boolean - A boolean, if no value is defined the default value of this variable will be `true`, the variable will also be :term:`mandatory` by default - - + - - `true` - + `false` * - secret - a secret (like a password, a private key, etc.) - - + - - `hO_'hi` - * - mail - - a mail address - - + * - mail + - a mail address + - - test@rougail.example * - unix_filename - a file name in the Unix meaning - - + - - :file:`/etc/passwd` - * - date + * - date - a date in the format `%Y-%m-%d` - - + - - `2021-01-30` * - unix_user - - a user in the Unix meaning - - + - a user in the Unix meaning + - - test * - ip - any kind of IPv4 address @@ -212,73 +234,73 @@ This type enables the variable to define the values that are accepted by this va * - cidr - any IPv4 address in the CIDR format - `private_only`: only private IPs (`false` by default) - - `allow_reserved`: allows reserved IPs (`false` by default) + + `allow_reserved`: allows reserved IPs (`false` by default) - `1.2.3.4/24` * - netmask - mask of an IPv4 address - - + - - `255.255.255.0` * - network - network address - - + - - `192.168.1.0` * - network_cidr - network address in CIDR format - - + - - `192.168.1.0/24` * - broadcast - broadcast address - - + - - `255.255.255.255` * - netbios - - netbios name - - + - netbios name + - - machine * - domainname - - domain name + - domain name - `allow_ip`: allows an IP rather than a domain name (`false` by default) - + `allow_cidr_network`: allows a CIDR type network address (`false` by default) - + `allow_without_dot`: allows names without a dot (`false` by default) - + `allow_startswith_dot`: allows starting with a point (`false` by default) - `rougail.example` - * - hostname - - host name + * - hostname + - host name - `allow_ip`: allows an IP rather than a domain name (`false` by default) - machine * - web_address - web address - `allow_ip`: allows an IP rather than a domain name (`false` by default) - + `allow_without_dot`: allows names without a dot (`true` by default) - http://rougail.example - * - port - - port + * - port + - port - `allow_range`: allows a port range, for example 80:85 (`false` by default) `allow_zero`: allows port 0 (false by default) `allow_wellknown`: allows ports from 1 to 1023 (`true` by default) - + `allow_registred`: allows ports from 1024 to 49151 (`true` by default) - + `allow_private`: allows ports greater than 49152 (`true` by default) - + `allow_protocol`: allows the addition of the protocol, for example tcp:80 (`false` by default) - + - 8080 * - mac - MAC address - - + - - 11:11:11:11:11:11 * - unix_permissions - access rights to the file, directory, etc. - - + - - 644 - * - choice - - choice variable - - - - + * - choice + - choice variable + - + - diff --git a/pyproject.toml b/pyproject.toml index 859db2627..9a9d9e69e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ ] dependencies = [ - "pyyaml ~= 6.0.1", + "ruamel.yaml ~= 0.17.40", "pydantic ~= 2.5.2", "jinja2 ~= 3.1.2", "tiramisu ~= 4.1.0", diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 2891b6d19..1eac66c68 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -78,16 +78,19 @@ class Annotator(Walk): # pylint: disable=R0903 f'the follower "{variable.name}" without multi attribute can only have one value' ) 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 - variable.default = None - else: - self.objectspace.default_multi[variable.path] = variable.default[ - 0 - ] + if not variable.default: + variable.default = None + else: + if variable.path not in self.objectspace.leaders: + if multi == "submulti": + self.objectspace.default_multi[ + variable.path + ] = variable.default + variable.default = None + else: + self.objectspace.default_multi[variable.path] = variable.default[ + 0 + ] elif variable.multi: msg = _(f'the variable "{variable.name}" is multi but has a non list default value') raise DictConsistencyError(msg, 12, variable.xmlfiles) diff --git a/src/rougail/config.py b/src/rougail/config.py index 613c879d4..5bd0e2b3c 100644 --- a/src/rougail/config.py +++ b/src/rougail/config.py @@ -43,8 +43,6 @@ RougailConfig = { "templates_dir": join(ROUGAILROOT, "templates"), "destinations_dir": join(ROUGAILROOT, "destinations"), "tmp_dir": join(ROUGAILROOT, "tmp"), - "dtdfilename": join(DTDDIR, "rougail.dtd"), - "yamlschema_filename": join(DTDDIR, "rougail.yml"), "functions_file": join(ROUGAILROOT, "functions.py"), "system_service_directory": "/usr/lib/systemd/system", "systemd_service_destination_directory": "/usr/local/lib", diff --git a/src/rougail/convert.py b/src/rougail/convert.py index 526092abb..6f04a7b2c 100644 --- a/src/rougail/convert.py +++ b/src/rougail/convert.py @@ -44,7 +44,8 @@ from typing import ( from itertools import chain from re import findall, compile -from yaml import safe_load +from ruamel.yaml import YAML +from ruamel.yaml.comments import CommentedMap from pydantic import ValidationError from tiramisu.error import display_list @@ -338,6 +339,7 @@ class ParserVariable: path: str, obj: dict, family_is_leadership: bool, + version: str, filename: str, ) -> Literal["variable", "family"]: """Check object to determine if it's a variable or a family""" @@ -363,18 +365,24 @@ class ParserVariable: return "variable" # all attributes are in variable object # and values in attributes are not dict is not Calculation - extra_keys = set(obj) - self.choice_attrs - if not extra_keys: - for key, value in obj.items(): - if isinstance(value, dict) and not self.is_calculation( - key, - value, - self.choice_calculations, - False, - ): - break - else: - return "variable" + if isinstance(obj, dict): + extra_keys = set(obj) - self.choice_attrs + if not extra_keys: + for key, value in obj.items(): + if isinstance(value, dict) and not self.is_calculation( + key, + value, + self.choice_calculations, + False, + ): + break + else: + return "variable" + else: + if version == '1.0': + msg = f'Invalid value for the variable "{path}": "{obj}"' + raise DictConsistencyError(msg, 102, [filename]) + return "variable" return "family" def get_family_or_variable_type( @@ -382,6 +390,8 @@ class ParserVariable: obj: dict, ) -> Optional[str]: """Check 'type' attributes""" + if not isinstance(obj, dict): + return None if "_type" in obj: # only family has _type attributs return obj["_type"] @@ -399,6 +409,7 @@ class ParserVariable: subpath: str, obj: dict, version: str, + comment: Optional[str], *, first_variable: bool = False, family_is_leadership: bool = False, @@ -409,10 +420,14 @@ class ParserVariable: msg = f'the variable or family name "{name}" is incorrect, it must not starts with "_" character' raise DictConsistencyError(msg, 16, [filename]) path = f"{subpath}.{name}" + if version == '0.1' and not isinstance(obj, dict) and obj is not None: + msg = f'the variable "{path}" has a wrong type "{type(obj)}"' + raise DictConsistencyError(msg, 17, [filename]) typ = self.is_family_or_variable( path, obj, family_is_leadership, + version, filename, ) logging.info("family_or_variable: %s is a %s", path, typ) @@ -426,6 +441,7 @@ class ParserVariable: path, obj, version, + comment=comment, first_variable=first_variable, family_is_leadership=family_is_leadership, family_is_dynamic=family_is_dynamic, @@ -440,6 +456,7 @@ class ParserVariable: obj: Optional[Dict[str, Any]], version: str, *, + comment: Optional[str] = None, first_variable: bool = False, family_is_leadership: bool = False, family_is_dynamic: bool = False, @@ -494,6 +511,8 @@ class ParserVariable: if '{{ suffix }}' not in name: msg = f'dynamic family name must have "{{{{ suffix }}}}" in his name for "{path}"' raise DictConsistencyError(msg, 13, [filename]) + if version != '1.0' and not family_obj and comment: + family_obj['description'] = comment self.add_family( path, name, @@ -508,18 +527,15 @@ class ParserVariable: family_is_leadership = True for idx, key in enumerate(subfamily_obj): value = subfamily_obj[key] - if not isinstance(value, dict) and value is not None: - msg = f'the variable "{path}.{key}" has a wrong type "{type(value)}"' - raise DictConsistencyError(msg, 17, [filename]) first_variable = not force_not_first and idx == 0 - if value is None: - value = {} + comment = self.get_comment(key, obj) self.family_or_variable( filename, key, path, value, version, + comment, first_variable=first_variable, family_is_leadership=family_is_leadership, family_is_dynamic=family_is_dynamic, @@ -628,15 +644,22 @@ class ParserVariable: obj: Optional[Dict[str, Any]], version: str, *, + comment: Optional[str] = None, first_variable: bool = False, family_is_leadership: bool = False, family_is_dynamic: bool = False, parent_dynamic: Optional[str] = None, ) -> None: """Parse variable""" - if obj is None: - obj = {} - extra_attrs = set(obj) - self.choice_attrs + if version == '1.0' or isinstance(obj, dict): + if obj is None: + obj = {} + extra_attrs = set(obj) - self.choice_attrs + else: + extra_attrs = [] + obj = {'default': obj} + if comment: + obj['description'] = comment if extra_attrs: raise Exception( f'"{path}" is not a valid variable, there are additional ' @@ -930,6 +953,7 @@ class RougailConvert(ParserVariable): def __init__(self, rougailconfig) -> None: self.annotator = False + self.yaml = YAML() super().__init__(rougailconfig) def search_calculation( @@ -1007,6 +1031,18 @@ class RougailConvert(ParserVariable): if path_prefix: self.path_prefix = None + def get_comment(self, + name: str, + objects: CommentedMap, + ) -> Optional[str]: + if name in objects.ca.items: + comment = objects.ca.items[name][2] + else: + comment = None + if comment: + comment = comment.value[1:].strip() + return comment + def parse_variable_file( self, filename: str, @@ -1014,7 +1050,7 @@ class RougailConvert(ParserVariable): ) -> None: """Parse file""" with open(filename, encoding="utf8") as file_fh: - objects = safe_load(file_fh) + objects = self.yaml.load(file_fh) version = self.validate_file_version( objects, filename, @@ -1027,12 +1063,14 @@ class RougailConvert(ParserVariable): version, ) for name, obj in objects.items(): + comment = self.get_comment(name, objects) self.family_or_variable( filename, name, path, obj, version, + comment, ) def get_sorted_filename( diff --git a/src/rougail/update.py b/src/rougail/update.py index 80494cf6f..bd30ea881 100644 --- a/src/rougail/update.py +++ b/src/rougail/update.py @@ -35,7 +35,8 @@ except ModuleNotFoundError as err: # from ast import parse as ast_parse from json import dumps -from yaml import safe_load, dump, SafeDumper +from ruamel.yaml import YAML +from yaml import dump, SafeDumper from pathlib import Path from .i18n import _ @@ -57,11 +58,6 @@ def get_function_name(version): FUNCTION_VERSIONS = [(version, get_function_name(version)) for version in VERSIONS] -class NoAliasDumper(SafeDumper): - def ignore_aliases(self, data): - return True - - class upgrade_010_to_10: def __init__( self, @@ -648,7 +644,7 @@ class RougailUpgrade: ext = "xml" else: with xmlsrc.open() as xml_fh: - root = safe_load(xml_fh) + root = YAML(typ='safe').load(file_fh) search_function_name = get_function_name(str(root["version"])) ext = "yml" function_found = False @@ -671,23 +667,19 @@ class RougailUpgrade: root["version"] = version xmldst.parent.mkdir(parents=True, exist_ok=True) with xmldst.open("w") as ymlfh: - dump( + yaml = YAML() + yaml.dump( root, - ymlfh, - allow_unicode=True, - sort_keys=False, - Dumper=NoAliasDumper, + xmldst, ) if root_services and services_dstfolder: root_services["version"] = version ymldst_services.parent.mkdir(parents=True, exist_ok=True) with ymldst_services.open("w") as ymlfh: - dump( + yaml = YAML() + yaml.dump( root_services, ymlfh, - allow_unicode=True, - sort_keys=False, - Dumper=NoAliasDumper, ) def _attribut_to_bool(self, variable): diff --git a/tests/dictionaries/01base_bool_shorthand/__init__.py b/tests/dictionaries/01base_bool_shorthand/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_bool_shorthand/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_bool_shorthand/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..70dd511ce --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/dictionaries/rougail/00-base.yml @@ -0,0 +1,9 @@ +--- +version: '1.1' +bool: true +bool_multi: + - false +family: + bool: true + bool_multi: + - false diff --git a/tests/dictionaries/01base_bool_shorthand/makedict/after.json b/tests/dictionaries/01base_bool_shorthand/makedict/after.json new file mode 100644 index 000000000..b2c8cf378 --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/makedict/after.json @@ -0,0 +1,22 @@ +{ + "rougail.bool": { + "owner": "default", + "value": true + }, + "rougail.bool_multi": { + "owner": "default", + "value": [ + false + ] + }, + "rougail.family.bool": { + "owner": "default", + "value": true + }, + "rougail.family.bool_multi": { + "owner": "default", + "value": [ + false + ] + } +} diff --git a/tests/dictionaries/01base_bool_shorthand/makedict/base.json b/tests/dictionaries/01base_bool_shorthand/makedict/base.json new file mode 100644 index 000000000..0a56e2bb1 --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/makedict/base.json @@ -0,0 +1,10 @@ +{ + "rougail.bool": true, + "rougail.bool_multi": [ + false + ], + "rougail.family.bool": true, + "rougail.family.bool_multi": [ + false + ] +} diff --git a/tests/dictionaries/01base_bool_shorthand/makedict/before.json b/tests/dictionaries/01base_bool_shorthand/makedict/before.json new file mode 100644 index 000000000..b2c8cf378 --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/makedict/before.json @@ -0,0 +1,22 @@ +{ + "rougail.bool": { + "owner": "default", + "value": true + }, + "rougail.bool_multi": { + "owner": "default", + "value": [ + false + ] + }, + "rougail.family.bool": { + "owner": "default", + "value": true + }, + "rougail.family.bool_multi": { + "owner": "default", + "value": [ + false + ] + } +} diff --git a/tests/dictionaries/01base_bool_shorthand/makedict/mandatory.json b/tests/dictionaries/01base_bool_shorthand/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_bool_shorthand/tiramisu/base.py b/tests/dictionaries/01base_bool_shorthand/tiramisu/base.py new file mode 100644 index 000000000..e540ec7dc --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/tiramisu/base.py @@ -0,0 +1,14 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_2 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"})) +option_3 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"})) +option_5 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"})) +option_6 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_bool_shorthand/tiramisu/multi.py b/tests/dictionaries/01base_bool_shorthand/tiramisu/multi.py new file mode 100644 index 000000000..34c733519 --- /dev/null +++ b/tests/dictionaries/01base_bool_shorthand/tiramisu/multi.py @@ -0,0 +1,22 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_3 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"})) +option_4 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"})) +option_6 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"})) +option_7 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_10 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"})) +option_11 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"})) +option_13 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"})) +option_14 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01base_float_shorthand/__init__.py b/tests/dictionaries/01base_float_shorthand/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_float_shorthand/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_float_shorthand/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..51b4648e7 --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/dictionaries/rougail/00-base.yml @@ -0,0 +1,9 @@ +--- +version: '1.1' +float: 0.527 +float_multi: + - 0.527 +family: + float: 0.527 + float_multi: + - 0.527 diff --git a/tests/dictionaries/01base_float_shorthand/makedict/after.json b/tests/dictionaries/01base_float_shorthand/makedict/after.json new file mode 100644 index 000000000..77f66ded9 --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/makedict/after.json @@ -0,0 +1,22 @@ +{ + "rougail.float": { + "owner": "default", + "value": 0.527 + }, + "rougail.float_multi": { + "owner": "default", + "value": [ + 0.527 + ] + }, + "rougail.family.float": { + "owner": "default", + "value": 0.527 + }, + "rougail.family.float_multi": { + "owner": "default", + "value": [ + 0.527 + ] + } +} diff --git a/tests/dictionaries/01base_float_shorthand/makedict/base.json b/tests/dictionaries/01base_float_shorthand/makedict/base.json new file mode 100644 index 000000000..245584378 --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/makedict/base.json @@ -0,0 +1,10 @@ +{ + "rougail.float": 0.527, + "rougail.float_multi": [ + 0.527 + ], + "rougail.family.float": 0.527, + "rougail.family.float_multi": [ + 0.527 + ] +} diff --git a/tests/dictionaries/01base_float_shorthand/makedict/before.json b/tests/dictionaries/01base_float_shorthand/makedict/before.json new file mode 100644 index 000000000..77f66ded9 --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/makedict/before.json @@ -0,0 +1,22 @@ +{ + "rougail.float": { + "owner": "default", + "value": 0.527 + }, + "rougail.float_multi": { + "owner": "default", + "value": [ + 0.527 + ] + }, + "rougail.family.float": { + "owner": "default", + "value": 0.527 + }, + "rougail.family.float_multi": { + "owner": "default", + "value": [ + 0.527 + ] + } +} diff --git a/tests/dictionaries/01base_float_shorthand/makedict/mandatory.json b/tests/dictionaries/01base_float_shorthand/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_float_shorthand/tiramisu/base.py b/tests/dictionaries/01base_float_shorthand/tiramisu/base.py new file mode 100644 index 000000000..a66d37df5 --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/tiramisu/base.py @@ -0,0 +1,14 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_2 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"})) +option_3 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"})) +option_5 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"})) +option_6 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_float_shorthand/tiramisu/multi.py b/tests/dictionaries/01base_float_shorthand/tiramisu/multi.py new file mode 100644 index 000000000..b794336a6 --- /dev/null +++ b/tests/dictionaries/01base_float_shorthand/tiramisu/multi.py @@ -0,0 +1,22 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_3 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"})) +option_4 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"})) +option_6 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"})) +option_7 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_10 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"})) +option_11 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"})) +option_13 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"})) +option_14 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01base_int_shorthand/__init__.py b/tests/dictionaries/01base_int_shorthand/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_int_shorthand/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_int_shorthand/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..8e7af82e9 --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/dictionaries/rougail/00-base.yml @@ -0,0 +1,9 @@ +--- +version: '1.1' +int: 1 +int_multi: + - 1 +family: + int: 1 + int_multi: + - 1 diff --git a/tests/dictionaries/01base_int_shorthand/makedict/after.json b/tests/dictionaries/01base_int_shorthand/makedict/after.json new file mode 100644 index 000000000..7e8b76f4f --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/makedict/after.json @@ -0,0 +1,22 @@ +{ + "rougail.int": { + "owner": "default", + "value": 1 + }, + "rougail.int_multi": { + "owner": "default", + "value": [ + 1 + ] + }, + "rougail.family.int": { + "owner": "default", + "value": 1 + }, + "rougail.family.int_multi": { + "owner": "default", + "value": [ + 1 + ] + } +} diff --git a/tests/dictionaries/01base_int_shorthand/makedict/base.json b/tests/dictionaries/01base_int_shorthand/makedict/base.json new file mode 100644 index 000000000..facee83d8 --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/makedict/base.json @@ -0,0 +1,10 @@ +{ + "rougail.int": 1, + "rougail.int_multi": [ + 1 + ], + "rougail.family.int": 1, + "rougail.family.int_multi": [ + 1 + ] +} diff --git a/tests/dictionaries/01base_int_shorthand/makedict/before.json b/tests/dictionaries/01base_int_shorthand/makedict/before.json new file mode 100644 index 000000000..7e8b76f4f --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/makedict/before.json @@ -0,0 +1,22 @@ +{ + "rougail.int": { + "owner": "default", + "value": 1 + }, + "rougail.int_multi": { + "owner": "default", + "value": [ + 1 + ] + }, + "rougail.family.int": { + "owner": "default", + "value": 1 + }, + "rougail.family.int_multi": { + "owner": "default", + "value": [ + 1 + ] + } +} diff --git a/tests/dictionaries/01base_int_shorthand/makedict/mandatory.json b/tests/dictionaries/01base_int_shorthand/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_int_shorthand/tiramisu/base.py b/tests/dictionaries/01base_int_shorthand/tiramisu/base.py new file mode 100644 index 000000000..ab5e8cebf --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/tiramisu/base.py @@ -0,0 +1,14 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_2 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"})) +option_3 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +option_5 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"})) +option_6 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_int_shorthand/tiramisu/multi.py b/tests/dictionaries/01base_int_shorthand/tiramisu/multi.py new file mode 100644 index 000000000..47e69b43b --- /dev/null +++ b/tests/dictionaries/01base_int_shorthand/tiramisu/multi.py @@ -0,0 +1,22 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_3 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"})) +option_4 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +option_6 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"})) +option_7 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_10 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"})) +option_11 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +option_13 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"})) +option_14 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01base_shorthand/__init__.py b/tests/dictionaries/01base_shorthand/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_shorthand/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_shorthand/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..4234b6773 --- /dev/null +++ b/tests/dictionaries/01base_shorthand/dictionaries/rougail/00-base.yml @@ -0,0 +1,15 @@ +--- +version: '1.1' +root_variable: # With root comment +root_int: 1 # With root int comment +family: # With comment + variable: # With variable comment + int: 1 # With comment for an integer + multi: # With comment for a multi + - 0.1 + - 0.2 + empty_multi: [] # With comment for an empty multi +family_not_shorthand: # Not a description + hidden: true + variable: # Not a description + default: true diff --git a/tests/dictionaries/01base_shorthand/makedict/after.json b/tests/dictionaries/01base_shorthand/makedict/after.json new file mode 100644 index 000000000..1f40d3df5 --- /dev/null +++ b/tests/dictionaries/01base_shorthand/makedict/after.json @@ -0,0 +1,33 @@ +{ + "rougail.root_variable": { + "owner": "default", + "value": null + }, + "rougail.root_int": { + "owner": "default", + "value": 1 + }, + "rougail.family.variable": { + "owner": "default", + "value": null + }, + "rougail.family.int": { + "owner": "default", + "value": 1 + }, + "rougail.family.multi": { + "owner": "default", + "value": [ + 0.1, + 0.2 + ] + }, + "rougail.family.empty_multi": { + "owner": "default", + "value": [] + }, + "rougail.family_not_shorthand.variable": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/01base_shorthand/makedict/base.json b/tests/dictionaries/01base_shorthand/makedict/base.json new file mode 100644 index 000000000..f7660de50 --- /dev/null +++ b/tests/dictionaries/01base_shorthand/makedict/base.json @@ -0,0 +1,12 @@ +{ + "rougail.root_variable": null, + "rougail.root_int": 1, + "rougail.family.variable": null, + "rougail.family.int": 1, + "rougail.family.multi": [ + 0.1, + 0.2 + ], + "rougail.family.empty_multi": [], + "rougail.family_not_shorthand.variable": true +} diff --git a/tests/dictionaries/01base_shorthand/makedict/before.json b/tests/dictionaries/01base_shorthand/makedict/before.json new file mode 100644 index 000000000..1f40d3df5 --- /dev/null +++ b/tests/dictionaries/01base_shorthand/makedict/before.json @@ -0,0 +1,33 @@ +{ + "rougail.root_variable": { + "owner": "default", + "value": null + }, + "rougail.root_int": { + "owner": "default", + "value": 1 + }, + "rougail.family.variable": { + "owner": "default", + "value": null + }, + "rougail.family.int": { + "owner": "default", + "value": 1 + }, + "rougail.family.multi": { + "owner": "default", + "value": [ + 0.1, + 0.2 + ] + }, + "rougail.family.empty_multi": { + "owner": "default", + "value": [] + }, + "rougail.family_not_shorthand.variable": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/01base_shorthand/makedict/mandatory.json b/tests/dictionaries/01base_shorthand/makedict/mandatory.json new file mode 100644 index 000000000..ae2914959 --- /dev/null +++ b/tests/dictionaries/01base_shorthand/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.root_variable", "rougail.family.variable", "rougail.family.empty_multi"] \ No newline at end of file diff --git a/tests/dictionaries/01base_shorthand/tiramisu/base.py b/tests/dictionaries/01base_shorthand/tiramisu/base.py new file mode 100644 index 000000000..939fb47fd --- /dev/null +++ b/tests/dictionaries/01base_shorthand/tiramisu/base.py @@ -0,0 +1,18 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_2 = StrOption(name="root_variable", doc="With root comment", properties=frozenset({"basic", "mandatory"})) +option_3 = IntOption(name="root_int", doc="With root int comment", default=1, properties=frozenset({"mandatory", "standard"})) +option_5 = StrOption(name="variable", doc="With variable comment", properties=frozenset({"basic", "mandatory"})) +option_6 = IntOption(name="int", doc="With comment for an integer", default=1, properties=frozenset({"mandatory", "standard"})) +option_7 = FloatOption(name="multi", doc="With comment for a multi", multi=True, default=[0.1, 0.2], default_multi=0.1, properties=frozenset({"mandatory", "notempty", "standard"})) +option_8 = StrOption(name="empty_multi", doc="With comment for an empty multi", multi=True, properties=frozenset({"basic", "mandatory", "notempty"})) +optiondescription_4 = OptionDescription(name="family", doc="With comment", children=[option_5, option_6, option_7, option_8], properties=frozenset({"basic"})) +option_10 = BoolOption(name="variable", doc="variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "standard"})) +optiondescription_9 = OptionDescription(name="family_not_shorthand", doc="family_not_shorthand", children=[option_10], properties=frozenset({"hidden", "standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4, optiondescription_9], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_shorthand/tiramisu/multi.py b/tests/dictionaries/01base_shorthand/tiramisu/multi.py new file mode 100644 index 000000000..1149d8282 --- /dev/null +++ b/tests/dictionaries/01base_shorthand/tiramisu/multi.py @@ -0,0 +1,30 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_3 = StrOption(name="root_variable", doc="With root comment", properties=frozenset({"basic", "mandatory"})) +option_4 = IntOption(name="root_int", doc="With root int comment", default=1, properties=frozenset({"mandatory", "standard"})) +option_6 = StrOption(name="variable", doc="With variable comment", properties=frozenset({"basic", "mandatory"})) +option_7 = IntOption(name="int", doc="With comment for an integer", default=1, properties=frozenset({"mandatory", "standard"})) +option_8 = FloatOption(name="multi", doc="With comment for a multi", multi=True, default=[0.1, 0.2], default_multi=0.1, properties=frozenset({"mandatory", "notempty", "standard"})) +option_9 = StrOption(name="empty_multi", doc="With comment for an empty multi", multi=True, properties=frozenset({"basic", "mandatory", "notempty"})) +optiondescription_5 = OptionDescription(name="family", doc="With comment", children=[option_6, option_7, option_8, option_9], properties=frozenset({"basic"})) +option_11 = BoolOption(name="variable", doc="variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "standard"})) +optiondescription_10 = OptionDescription(name="family_not_shorthand", doc="family_not_shorthand", children=[option_11], properties=frozenset({"hidden", "standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5, optiondescription_10], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"})) +option_14 = StrOption(name="root_variable", doc="With root comment", properties=frozenset({"basic", "mandatory"})) +option_15 = IntOption(name="root_int", doc="With root int comment", default=1, properties=frozenset({"mandatory", "standard"})) +option_17 = StrOption(name="variable", doc="With variable comment", properties=frozenset({"basic", "mandatory"})) +option_18 = IntOption(name="int", doc="With comment for an integer", default=1, properties=frozenset({"mandatory", "standard"})) +option_19 = FloatOption(name="multi", doc="With comment for a multi", multi=True, default=[0.1, 0.2], default_multi=0.1, properties=frozenset({"mandatory", "notempty", "standard"})) +option_20 = StrOption(name="empty_multi", doc="With comment for an empty multi", multi=True, properties=frozenset({"basic", "mandatory", "notempty"})) +optiondescription_16 = OptionDescription(name="family", doc="With comment", children=[option_17, option_18, option_19, option_20], properties=frozenset({"basic"})) +option_22 = BoolOption(name="variable", doc="variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "standard"})) +optiondescription_21 = OptionDescription(name="family_not_shorthand", doc="family_not_shorthand", children=[option_22], properties=frozenset({"hidden", "standard"})) +optiondescription_13 = OptionDescription(name="rougail", doc="rougail", children=[option_14, option_15, optiondescription_16, optiondescription_21], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="2", doc="2", children=[optiondescription_13], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_12]) diff --git a/tests/dictionaries/01base_string_shorthand/__init__.py b/tests/dictionaries/01base_string_shorthand/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_string_shorthand/dictionaries/rougail/00-base.yml b/tests/dictionaries/01base_string_shorthand/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..8cef93daf --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/dictionaries/rougail/00-base.yml @@ -0,0 +1,9 @@ +--- +version: '1.1' +string: value +string_multi: + - value +family: + string: value + string_multi: + - value diff --git a/tests/dictionaries/01base_string_shorthand/makedict/after.json b/tests/dictionaries/01base_string_shorthand/makedict/after.json new file mode 100644 index 000000000..a0d00f6fe --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/makedict/after.json @@ -0,0 +1,22 @@ +{ + "rougail.string": { + "owner": "default", + "value": "value" + }, + "rougail.string_multi": { + "owner": "default", + "value": [ + "value" + ] + }, + "rougail.family.string": { + "owner": "default", + "value": "value" + }, + "rougail.family.string_multi": { + "owner": "default", + "value": [ + "value" + ] + } +} diff --git a/tests/dictionaries/01base_string_shorthand/makedict/base.json b/tests/dictionaries/01base_string_shorthand/makedict/base.json new file mode 100644 index 000000000..e5dfb8cc0 --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/makedict/base.json @@ -0,0 +1,10 @@ +{ + "rougail.string": "value", + "rougail.string_multi": [ + "value" + ], + "rougail.family.string": "value", + "rougail.family.string_multi": [ + "value" + ] +} diff --git a/tests/dictionaries/01base_string_shorthand/makedict/before.json b/tests/dictionaries/01base_string_shorthand/makedict/before.json new file mode 100644 index 000000000..a0d00f6fe --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/makedict/before.json @@ -0,0 +1,22 @@ +{ + "rougail.string": { + "owner": "default", + "value": "value" + }, + "rougail.string_multi": { + "owner": "default", + "value": [ + "value" + ] + }, + "rougail.family.string": { + "owner": "default", + "value": "value" + }, + "rougail.family.string_multi": { + "owner": "default", + "value": [ + "value" + ] + } +} diff --git a/tests/dictionaries/01base_string_shorthand/makedict/mandatory.json b/tests/dictionaries/01base_string_shorthand/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_string_shorthand/tiramisu/base.py b/tests/dictionaries/01base_string_shorthand/tiramisu/base.py new file mode 100644 index 000000000..c7111d321 --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/tiramisu/base.py @@ -0,0 +1,14 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_2 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"})) +option_3 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"})) +option_5 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"})) +option_6 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/01base_string_shorthand/tiramisu/multi.py b/tests/dictionaries/01base_string_shorthand/tiramisu/multi.py new file mode 100644 index 000000000..721a47dcd --- /dev/null +++ b/tests/dictionaries/01base_string_shorthand/tiramisu/multi.py @@ -0,0 +1,22 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_3 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"})) +option_4 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"})) +option_6 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"})) +option_7 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_10 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"})) +option_11 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"})) +option_13 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"})) +option_14 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01test_boolean/dictionaries/rougail/00-base.yml b/tests/dictionaries/01test_boolean/dictionaries/rougail/00-base.yml index cb4fae901..fd56a3d2a 100644 --- a/tests/dictionaries/01test_boolean/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/01test_boolean/dictionaries/rougail/00-base.yml @@ -1,7 +1,8 @@ +--- +version: '1.0' general: mode_conteneur_actif: type: "boolean" test: - false default: true -version: '1.0' diff --git a/tests/dictionaries/10leadership_autoleader_expert/makedict/after.json b/tests/dictionaries/10leadership_autoleader_expert/makedict/after.json new file mode 100644 index 000000000..620f2e4ba --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader_expert/makedict/after.json @@ -0,0 +1,24 @@ +{ + "rougail.leadermode.leader.leader": { + "owner": "default", + "value": [ + "valfill" + ] + }, + "rougail.leadermode.leader.follower1": { + "owner": [ + "default" + ], + "value": [ + null + ] + }, + "rougail.leadermode.leader.follower2": { + "owner": [ + "default" + ], + "value": [ + null + ] + } +} diff --git a/tests/dictionaries/10leadership_autoleader_expert/makedict/base.json b/tests/dictionaries/10leadership_autoleader_expert/makedict/base.json new file mode 100644 index 000000000..4af4d0a83 --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader_expert/makedict/base.json @@ -0,0 +1,9 @@ +{ + "rougail.leadermode.leader.leader": [ + { + "rougail.leadermode.leader.leader": "valfill", + "rougail.leadermode.leader.follower1": null, + "rougail.leadermode.leader.follower2": null + } + ] +} diff --git a/tests/dictionaries/10leadership_autoleader_expert/makedict/before.json b/tests/dictionaries/10leadership_autoleader_expert/makedict/before.json new file mode 100644 index 000000000..620f2e4ba --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader_expert/makedict/before.json @@ -0,0 +1,24 @@ +{ + "rougail.leadermode.leader.leader": { + "owner": "default", + "value": [ + "valfill" + ] + }, + "rougail.leadermode.leader.follower1": { + "owner": [ + "default" + ], + "value": [ + null + ] + }, + "rougail.leadermode.leader.follower2": { + "owner": [ + "default" + ], + "value": [ + null + ] + } +} diff --git a/tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json b/tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_unknown_suffix/dictionaries/rougail/00-base.yml index c7bd62fe4..44b678782 100644 --- a/tests/dictionaries/20family_dynamic_unknown_suffix/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/dictionaries/rougail/00-base.yml @@ -26,3 +26,9 @@ varname: default: type: variable variable: rougail.val4_dyn.var1 + disabled: + type: jinja + jinja: | + {% if 'val4' not in __.varname %} + val4 is not a valid value + {% endif %} diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/after.json b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/after.json new file mode 100644 index 000000000..330cfde31 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/after.json @@ -0,0 +1,33 @@ +{ + "rougail.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.val1_dyn.var1": { + "owner": "default", + "value": "val1" + }, + "rougail.val1_dyn.var2": { + "owner": "default", + "value": "val1" + }, + "rougail.val1_dyn.var3": { + "owner": "default", + "value": "val1" + }, + "rougail.val2_dyn.var1": { + "owner": "default", + "value": "val2" + }, + "rougail.val2_dyn.var2": { + "owner": "default", + "value": "val2" + }, + "rougail.val2_dyn.var3": { + "owner": "default", + "value": "val2" + } +} diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/base.json b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/base.json new file mode 100644 index 000000000..bcf2812b7 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/base.json @@ -0,0 +1,12 @@ +{ + "rougail.varname": [ + "val1", + "val2" + ], + "rougail.val1_dyn.var1": "val1", + "rougail.val1_dyn.var2": "val1", + "rougail.val1_dyn.var3": "val1", + "rougail.val2_dyn.var1": "val2", + "rougail.val2_dyn.var2": "val2", + "rougail.val2_dyn.var3": "val2" +} diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/before.json b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/before.json new file mode 100644 index 000000000..330cfde31 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/before.json @@ -0,0 +1,33 @@ +{ + "rougail.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.val1_dyn.var1": { + "owner": "default", + "value": "val1" + }, + "rougail.val1_dyn.var2": { + "owner": "default", + "value": "val1" + }, + "rougail.val1_dyn.var3": { + "owner": "default", + "value": "val1" + }, + "rougail.val2_dyn.var1": { + "owner": "default", + "value": "val2" + }, + "rougail.val2_dyn.var2": { + "owner": "default", + "value": "val2" + }, + "rougail.val2_dyn.var3": { + "owner": "default", + "value": "val2" + } +} diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/base.py b/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/base.py index 183312f73..29e033b4f 100644 --- a/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/base.py @@ -5,11 +5,12 @@ load_functions('tests/dictionaries/../eosfunc/test.py') ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") +dict_env['disabled_rougail.{{ suffix }}_dyn.var4'] = "{% if 'val4' not in __.varname %}\nval4 is not a valid value\n{% endif %}\n" option_2 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) option_4 = StrOption(name="var1", doc="var1", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"})) option_5 = StrOption(name="var2", doc="var2", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), properties=frozenset({"mandatory", "standard"})) option_6 = StrOption(name="var3", doc="var3", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), properties=frozenset({"mandatory", "standard"})) -option_7 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_4, ['val4'])))), properties=frozenset({"mandatory", "standard"})) +option_7 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_4, ['val4'])))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.{{ suffix }}_dyn.var4"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__.varname': ParamOption(option_2)}), help_function=func['jinja_to_property_help'])})) optiondescription_3 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4, option_5, option_6, option_7], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, optiondescription_3], properties=frozenset({"standard"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/multi.py index 6456d66b3..c1139a5bb 100644 --- a/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_unknown_suffix/tiramisu/multi.py @@ -5,11 +5,13 @@ load_functions('tests/dictionaries/../eosfunc/test.py') ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") +dict_env['disabled_1.rougail.{{ suffix }}_dyn.var4'] = "{% if 'val4' not in __.varname %}\nval4 is not a valid value\n{% endif %}\n" +dict_env['disabled_2.rougail.{{ suffix }}_dyn.var4'] = "{% if 'val4' not in __.varname %}\nval4 is not a valid value\n{% endif %}\n" option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) option_5 = StrOption(name="var1", doc="var1", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"})) option_6 = StrOption(name="var2", doc="var2", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), properties=frozenset({"mandatory", "standard"})) option_7 = StrOption(name="var3", doc="var3", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), properties=frozenset({"mandatory", "standard"})) -option_8 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_5, ['val4'])))), properties=frozenset({"mandatory", "standard"})) +option_8 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_5, ['val4'])))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_1.rougail.{{ suffix }}_dyn.var4"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__.varname': ParamOption(option_3)}), help_function=func['jinja_to_property_help'])})) optiondescription_4 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3)))), children=[option_5, option_6, option_7, option_8], properties=frozenset({"standard"})) optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, optiondescription_4], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) @@ -17,7 +19,7 @@ option_11 = StrOption(name="varname", doc="varname", multi=True, default=["val1" option_13 = StrOption(name="var1", doc="var1", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"})) option_14 = StrOption(name="var2", doc="var2", default=Calculation(func['calc_value'], Params((ParamOption(option_13)))), properties=frozenset({"mandatory", "standard"})) option_15 = StrOption(name="var3", doc="var3", default=Calculation(func['calc_value'], Params((ParamOption(option_13)))), properties=frozenset({"mandatory", "standard"})) -option_16 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_13, ['val4'])))), properties=frozenset({"mandatory", "standard"})) +option_16 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_13, ['val4'])))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_2.rougail.{{ suffix }}_dyn.var4"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__.varname': ParamOption(option_11)}), help_function=func['jinja_to_property_help'])})) optiondescription_12 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_11)))), children=[option_13, option_14, option_15, option_16], properties=frozenset({"standard"})) optiondescription_10 = OptionDescription(name="rougail", doc="rougail", children=[option_11, optiondescription_12], properties=frozenset({"standard"})) optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"})) diff --git a/tests/dictionaries/40version_underscode/makedict/after.json b/tests/dictionaries/40version_underscode/makedict/after.json new file mode 100644 index 000000000..89411696b --- /dev/null +++ b/tests/dictionaries/40version_underscode/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.version": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/40version_underscode/makedict/base.json b/tests/dictionaries/40version_underscode/makedict/base.json new file mode 100644 index 000000000..2cc50833c --- /dev/null +++ b/tests/dictionaries/40version_underscode/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.version": null +} diff --git a/tests/dictionaries/40version_underscode/makedict/before.json b/tests/dictionaries/40version_underscode/makedict/before.json new file mode 100644 index 000000000..89411696b --- /dev/null +++ b/tests/dictionaries/40version_underscode/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.version": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/40version_underscode/makedict/mandatory.json b/tests/dictionaries/40version_underscode/makedict/mandatory.json new file mode 100644 index 000000000..0d8bb1aa1 --- /dev/null +++ b/tests/dictionaries/40version_underscode/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.version"] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_leadership/makedict/after.json b/tests/dictionaries/51redefine_leadership/makedict/after.json new file mode 100644 index 000000000..8e2cc2c2a --- /dev/null +++ b/tests/dictionaries/51redefine_leadership/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.leader.leader": { + "owner": "default", + "value": [] + } +} diff --git a/tests/dictionaries/51redefine_leadership/makedict/base.json b/tests/dictionaries/51redefine_leadership/makedict/base.json new file mode 100644 index 000000000..772473e91 --- /dev/null +++ b/tests/dictionaries/51redefine_leadership/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.leader.leader": [] +} diff --git a/tests/dictionaries/51redefine_leadership/makedict/before.json b/tests/dictionaries/51redefine_leadership/makedict/before.json new file mode 100644 index 000000000..8e2cc2c2a --- /dev/null +++ b/tests/dictionaries/51redefine_leadership/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.leader.leader": { + "owner": "default", + "value": [] + } +} diff --git a/tests/dictionaries/51redefine_leadership/makedict/mandatory.json b/tests/dictionaries/51redefine_leadership/makedict/mandatory.json new file mode 100644 index 000000000..8e267443d --- /dev/null +++ b/tests/dictionaries/51redefine_leadership/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.leader.leader"] \ No newline at end of file diff --git a/tests/dictionaries_old/01auto_jinja_if/result/rougail/00-base.yml b/tests/dictionaries_old/01auto_jinja_if/result/rougail/00-base.yml index 96c610a44..fb22c210b 100644 --- a/tests/dictionaries_old/01auto_jinja_if/result/rougail/00-base.yml +++ b/tests/dictionaries_old/01auto_jinja_if/result/rougail/00-base.yml @@ -6,7 +6,7 @@ general: mandatory: false default: type: jinja - jinja: '{% if mode_conteneur_actif1 == ''non'' %}non{% else %}oui{% endif %}' + jinja: "{% if mode_conteneur_actif1 == 'non' %}non{% else %}oui{% endif %}" mode_conteneur_actif1: type: string description: No change diff --git a/tests/dictionaries_old/01fill_autofreeze/result/rougail/00-base.yml b/tests/dictionaries_old/01fill_autofreeze/result/rougail/00-base.yml index 610786bfd..2976f5875 100644 --- a/tests/dictionaries_old/01fill_autofreeze/result/rougail/00-base.yml +++ b/tests/dictionaries_old/01fill_autofreeze/result/rougail/00-base.yml @@ -4,7 +4,7 @@ my_var1: type: jinja jinja: '{{ rougail.my_var2 | calc_val }}' my_var2: - default: 'no' + default: no server_deployed: type: boolean default: false diff --git a/tests/dictionaries_old/01fill_quote/result/rougail/00-base.yml b/tests/dictionaries_old/01fill_quote/result/rougail/00-base.yml index db1f62601..6e2b83821 100644 --- a/tests/dictionaries_old/01fill_quote/result/rougail/00-base.yml +++ b/tests/dictionaries_old/01fill_quote/result/rougail/00-base.yml @@ -5,7 +5,7 @@ general: mandatory: false default: type: jinja - jinja: '{{ "quote''" | calc_val }}' + jinja: "{{ \"quote'\" | calc_val }}" mode_conteneur_actif1: type: string description: No change @@ -19,12 +19,12 @@ general: mandatory: false default: type: jinja - jinja: '{{ "quote\"''" | calc_val }}' + jinja: "{{ \"quote\\\"'\" | calc_val }}" mode_conteneur_actif3: type: string description: No change mandatory: false default: type: jinja - jinja: '{{ "quote\"\\''" | calc_val }}' + jinja: "{{ \"quote\\\"\\\\'\" | calc_val }}" version: '1.1' diff --git a/tests/dictionaries_old/01test_multi_none/result/rougail/00-base.yml b/tests/dictionaries_old/01test_multi_none/result/rougail/00-base.yml index 4d3515a9f..4bd3ac5db 100644 --- a/tests/dictionaries_old/01test_multi_none/result/rougail/00-base.yml +++ b/tests/dictionaries_old/01test_multi_none/result/rougail/00-base.yml @@ -1,7 +1,7 @@ general: mode_conteneur_actif: test: - - null + - - test1 - test2 default: non diff --git a/tests/dictionaries_old/01test_redefine_remove/result/rougail/10-base.yml b/tests/dictionaries_old/01test_redefine_remove/result/rougail/10-base.yml index d6c12b06e..e5461ba1c 100644 --- a/tests/dictionaries_old/01test_redefine_remove/result/rougail/10-base.yml +++ b/tests/dictionaries_old/01test_redefine_remove/result/rougail/10-base.yml @@ -2,5 +2,5 @@ general: mode_conteneur_actif: redefine: true test: - - null + - version: '1.1' diff --git a/tests/dictionaries_old/02fill_multi_calc_val/result/rougail/00-base.yml b/tests/dictionaries_old/02fill_multi_calc_val/result/rougail/00-base.yml index 7f047d34a..e957acd8e 100644 --- a/tests/dictionaries_old/02fill_multi_calc_val/result/rougail/00-base.yml +++ b/tests/dictionaries_old/02fill_multi_calc_val/result/rougail/00-base.yml @@ -1,5 +1,5 @@ var1: - default: 'no' + default: no var2: multi: true mandatory: false diff --git a/tests/dictionaries_old/02fill_multi_calc_val_multi/result/rougail/00-base.yml b/tests/dictionaries_old/02fill_multi_calc_val_multi/result/rougail/00-base.yml index 9d6d59b73..a153ce429 100644 --- a/tests/dictionaries_old/02fill_multi_calc_val_multi/result/rougail/00-base.yml +++ b/tests/dictionaries_old/02fill_multi_calc_val_multi/result/rougail/00-base.yml @@ -1,8 +1,8 @@ var1: multi: true default: - - 'no' - - 'yes' + - no + - yes - maybe var2: multi: true diff --git a/tests/dictionaries_old/10load_disabled_if_in/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in/result/rougail/00-base.yml index b2fc6dc3e..71b0e0ab2 100644 --- a/tests/dictionaries_old/10load_disabled_if_in/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in/result/rougail/00-base.yml @@ -8,7 +8,7 @@ general: description: No change hidden: true default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: @@ -16,7 +16,5 @@ general: description: No change hidden: true default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_disabled_if_in_fill/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_fill/result/rougail/00-base.yml index 663780f5d..73e9aec3f 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_fill/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_fill/result/rougail/00-base.yml @@ -1,7 +1,7 @@ general: condition: type: string - default: 'no' + default: no variable1: type: string mandatory: false diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param/result/rougail/00-base.yml index 1ec03a0fd..a89e2546f 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param/result/rougail/00-base.yml @@ -8,7 +8,7 @@ general: description: No change hidden: true default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition == "maybe" %}disabled{% endif %}' @@ -17,8 +17,5 @@ general: description: No change hidden: true default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition - == "maybe" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param2/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param2/result/rougail/00-base.yml index 08974a0b1..b3d02fe1c 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param2/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param2/result/rougail/00-base.yml @@ -2,16 +2,16 @@ general: condition: type: string description: No change - default: 'no' + default: no condition2: type: string description: No change - default: 'no' + default: no test_variable: type: string description: No change hidden: true - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2 diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param3/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param3/result/rougail/00-base.yml index 08974a0b1..b3d02fe1c 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param3/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param3/result/rougail/00-base.yml @@ -2,16 +2,16 @@ general: condition: type: string description: No change - default: 'no' + default: no condition2: type: string description: No change - default: 'no' + default: no test_variable: type: string description: No change hidden: true - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2 diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param4/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param4/result/rougail/00-base.yml index 6ba502643..d23d1ca1d 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param4/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param4/result/rougail/00-base.yml @@ -2,16 +2,16 @@ general: condition: type: string description: No change - default: 'yes' + default: yes condition2: type: string description: No change - default: 'no' + default: no test_variable: type: string description: No change hidden: true - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2 diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param5/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param5/result/rougail/00-base.yml index 99e47b195..687d6baff 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param5/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param5/result/rougail/00-base.yml @@ -2,16 +2,16 @@ general: condition: type: string description: No change - default: 'yes' + default: yes condition2: type: string description: No change - default: 'yes' + default: yes test_variable: type: string description: No change hidden: true - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2 diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param6/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param6/result/rougail/00-base.yml index 9aab2ceab..4d1fde9f3 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param6/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param6/result/rougail/00-base.yml @@ -2,16 +2,16 @@ general: condition: type: string description: No change - default: 'no' + default: no condition2: type: string description: No change - default: 'yes' + default: yes test_variable: type: string description: No change hidden: true - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2 diff --git a/tests/dictionaries_old/10load_disabled_if_in_multi_param_disabled/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_multi_param_disabled/result/rougail/00-base.yml index 337e1652d..647816463 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_multi_param_disabled/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_multi_param_disabled/result/rougail/00-base.yml @@ -8,7 +8,7 @@ general: description: No change hidden: true default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition == "maybe" %}disabled{% endif %}' @@ -17,8 +17,5 @@ general: description: No change hidden: true default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition - == "maybe" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_disabled_if_in_none/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_none/result/rougail/00-base.yml index d7f8f3e7d..731274e3c 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_none/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_none/result/rougail/00-base.yml @@ -8,7 +8,7 @@ general: description: No change hidden: true default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == null %}disabled{% endif %}' mode_conteneur_actif2: @@ -16,7 +16,5 @@ general: description: No change hidden: true default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == null %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_disabled_if_in_twice/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_in_twice/result/rougail/00-base.yml index 7df60519f..324d0e8bf 100644 --- a/tests/dictionaries_old/10load_disabled_if_in_twice/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_in_twice/result/rougail/00-base.yml @@ -1,12 +1,12 @@ my_var1: - default: 'no' + default: no my_var2: - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.my_var1 == "no" %}disabled{% endif %}' my_var3: - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.my_var2 == "no" %}disabled{% endif %}' diff --git a/tests/dictionaries_old/10load_disabled_if_not_in_fallback/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabled_if_not_in_fallback/result/rougail/00-base.yml index 8b3cd43e0..7155f28fb 100644 --- a/tests/dictionaries_old/10load_disabled_if_not_in_fallback/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabled_if_not_in_fallback/result/rougail/00-base.yml @@ -2,11 +2,11 @@ general: condition: type: string description: No change - default: 'no' + default: no disable_variable: type: string description: No change - default: 'no' + default: no disabled: type: jinja jinja: '{% if __unknown == "no" %}{% else %}disabled{% endif %}' diff --git a/tests/dictionaries_old/10load_disabledifin_whithouttype/result/rougail/00-base.yml b/tests/dictionaries_old/10load_disabledifin_whithouttype/result/rougail/00-base.yml index fb681e03f..892a333df 100644 --- a/tests/dictionaries_old/10load_disabledifin_whithouttype/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_disabledifin_whithouttype/result/rougail/00-base.yml @@ -7,14 +7,12 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_frozenifin/result/rougail/00-base.yml b/tests/dictionaries_old/10load_frozenifin/result/rougail/00-base.yml index a0c3700cb..6ecdf3637 100644 --- a/tests/dictionaries_old/10load_frozenifin/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_frozenifin/result/rougail/00-base.yml @@ -7,14 +7,12 @@ general: type: string description: No change default: non - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_frozenifin_auto/result/rougail/00-base.yml b/tests/dictionaries_old/10load_frozenifin_auto/result/rougail/00-base.yml index 66afe8512..efdd9fd4b 100644 --- a/tests/dictionaries_old/10load_frozenifin_auto/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_frozenifin_auto/result/rougail/00-base.yml @@ -9,14 +9,12 @@ general: default: type: jinja jinja: '{{ "non" | calc_val }}' - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_frozenifin_multiparam/result/rougail/00-base.yml b/tests/dictionaries_old/10load_frozenifin_multiparam/result/rougail/00-base.yml index ac77f52e2..7f656e1ed 100644 --- a/tests/dictionaries_old/10load_frozenifin_multiparam/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_frozenifin_multiparam/result/rougail/00-base.yml @@ -11,7 +11,7 @@ general: type: string description: No change default: non - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "tous" or rougail.general.condition == "authentifié" %}hidden{% endif %}' @@ -19,8 +19,5 @@ general: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "tous" or rougail.general.condition - == "authentifié" %}hidden{% endif %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_frozenifin_noexist/result/rougail/00-base.yml b/tests/dictionaries_old/10load_frozenifin_noexist/result/rougail/00-base.yml index 0ecea6f8d..2e105db05 100644 --- a/tests/dictionaries_old/10load_frozenifin_noexist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_frozenifin_noexist/result/rougail/00-base.yml @@ -10,7 +10,7 @@ general: mode_conteneur_actif: type: string description: No change - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition == "non" %}hidden{% endif %}' @@ -18,9 +18,6 @@ general: mode_conteneur_actif2: type: string description: No change - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition - == "non" %}hidden{% endif %}' + hidden: *id001 default: non version: '1.1' diff --git a/tests/dictionaries_old/10load_frozenifnotin/result/rougail/00-base.yml b/tests/dictionaries_old/10load_frozenifnotin/result/rougail/00-base.yml index dce45d877..6f341e1a6 100644 --- a/tests/dictionaries_old/10load_frozenifnotin/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_frozenifnotin/result/rougail/00-base.yml @@ -7,7 +7,7 @@ general: type: string description: No change default: non - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}{% else %}hidden{% endif %}' @@ -15,8 +15,5 @@ general: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}{% else %}hidden{% endif - %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_frozenifnotin_noexist/result/rougail/00-base.yml b/tests/dictionaries_old/10load_frozenifnotin_noexist/result/rougail/00-base.yml index 9e42a4bef..c487d29a2 100644 --- a/tests/dictionaries_old/10load_frozenifnotin_noexist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_frozenifnotin_noexist/result/rougail/00-base.yml @@ -11,7 +11,7 @@ general: type: string description: No change default: non - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition == "non" %}{% else %}hidden{% endif %}' @@ -19,8 +19,5 @@ general: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition - == "non" %}{% else %}hidden{% endif %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_hidden_if_empty_family/result/rougail/00-base.yml b/tests/dictionaries_old/10load_hidden_if_empty_family/result/rougail/00-base.yml index 03b6d4ada..9caeded82 100644 --- a/tests/dictionaries_old/10load_hidden_if_empty_family/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_hidden_if_empty_family/result/rougail/00-base.yml @@ -8,19 +8,15 @@ general: type: string description: No change default: non - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' + hidden: *id001 general2: description: Général2 - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_hidden_if_family/result/rougail/00-base.yml b/tests/dictionaries_old/10load_hidden_if_family/result/rougail/00-base.yml index db203722e..3de9a6595 100644 --- a/tests/dictionaries_old/10load_hidden_if_family/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_hidden_if_family/result/rougail/00-base.yml @@ -8,16 +8,14 @@ general: type: string description: No change default: non - hidden: + hidden: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' + hidden: *id001 general2: description: Général2 mode_conteneur_actif3: @@ -25,7 +23,5 @@ general2: description: No change hidden: true default: non - hidden: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}' + hidden: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_mandatoryifin/result/rougail/00-base.yml b/tests/dictionaries_old/10load_mandatoryifin/result/rougail/00-base.yml index 4dd8e55ab..7bb67b25d 100644 --- a/tests/dictionaries_old/10load_mandatoryifin/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_mandatoryifin/result/rougail/00-base.yml @@ -7,14 +7,12 @@ general: type: string description: No change default: non - mandatory: + mandatory: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}mandatory{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - mandatory: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}mandatory{% endif %}' + mandatory: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10load_mandatoryifnotin_noexist/result/rougail/00-base.yml b/tests/dictionaries_old/10load_mandatoryifnotin_noexist/result/rougail/00-base.yml index 86616f679..7b50e948b 100644 --- a/tests/dictionaries_old/10load_mandatoryifnotin_noexist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10load_mandatoryifnotin_noexist/result/rougail/00-base.yml @@ -12,7 +12,7 @@ general: description: No change hidden: true default: non - mandatory: + mandatory: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition == "non" %}{% else %}mandatory{% endif %}' @@ -21,8 +21,5 @@ general: description: No change hidden: true default: non - mandatory: - type: jinja - jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition - == "non" %}{% else %}mandatory{% endif %}' + mandatory: *id001 version: '1.1' diff --git a/tests/dictionaries_old/10valid_enum_base_redefine/result/rougail/01-base.yml b/tests/dictionaries_old/10valid_enum_base_redefine/result/rougail/01-base.yml index 03de01a61..7d97f75d4 100644 --- a/tests/dictionaries_old/10valid_enum_base_redefine/result/rougail/01-base.yml +++ b/tests/dictionaries_old/10valid_enum_base_redefine/result/rougail/01-base.yml @@ -1,7 +1,7 @@ enumfam: enumvar: redefine: true - validators: null + validators: default: c choices: - a diff --git a/tests/dictionaries_old/10valid_enum_none/result/rougail/00-base.yml b/tests/dictionaries_old/10valid_enum_none/result/rougail/00-base.yml index d689937f8..998c5274e 100644 --- a/tests/dictionaries_old/10valid_enum_none/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10valid_enum_none/result/rougail/00-base.yml @@ -15,5 +15,5 @@ enumfam: choices: - a - b - - null + - version: '1.1' diff --git a/tests/dictionaries_old/10valid_enum_param_empty/result/rougail/00-base.yml b/tests/dictionaries_old/10valid_enum_param_empty/result/rougail/00-base.yml index ef267e9b1..b5ce91769 100644 --- a/tests/dictionaries_old/10valid_enum_param_empty/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10valid_enum_param_empty/result/rougail/00-base.yml @@ -4,7 +4,7 @@ enumfam: type: choice description: multi help: bla bla bla - default: null + default: choices: - - null + - version: '1.1' diff --git a/tests/dictionaries_old/10valid_enum_param_empty2/result/rougail/00-base.yml b/tests/dictionaries_old/10valid_enum_param_empty2/result/rougail/00-base.yml index bf82dee54..36f1b7e71 100644 --- a/tests/dictionaries_old/10valid_enum_param_empty2/result/rougail/00-base.yml +++ b/tests/dictionaries_old/10valid_enum_param_empty2/result/rougail/00-base.yml @@ -10,7 +10,7 @@ enumfam: type: choice description: multi help: bla bla bla - default: null + default: choices: - - null + - version: '1.1' diff --git a/tests/dictionaries_old/11disabled_if_in_filelist/result/rougail/00-base.yml b/tests/dictionaries_old/11disabled_if_in_filelist/result/rougail/00-base.yml index b7bcc817d..584dabddc 100644 --- a/tests/dictionaries_old/11disabled_if_in_filelist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/11disabled_if_in_filelist/result/rougail/00-base.yml @@ -7,13 +7,11 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: boolean description: No change - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/11disabled_if_in_filelist_disabled/result/rougail/00-base.yml b/tests/dictionaries_old/11disabled_if_in_filelist_disabled/result/rougail/00-base.yml index 778391dde..9f6ef14e9 100644 --- a/tests/dictionaries_old/11disabled_if_in_filelist_disabled/result/rougail/00-base.yml +++ b/tests/dictionaries_old/11disabled_if_in_filelist_disabled/result/rougail/00-base.yml @@ -7,14 +7,12 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/rougail/00-base.yml b/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/rougail/00-base.yml index fb681e03f..892a333df 100644 --- a/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/rougail/00-base.yml +++ b/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/rougail/00-base.yml @@ -7,14 +7,12 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/services/00-base.yml b/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/services/00-base.yml index d5e8b167b..c551ae202 100644 --- a/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/services/00-base.yml +++ b/tests/dictionaries_old/11disabled_if_in_filelist_multi/result/services/00-base.yml @@ -1,11 +1,9 @@ test.service: files: /tmp/file1: - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' /tmp/file2: - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/11disabled_if_in_filelist_same_name/result/rougail/00-base.yml b/tests/dictionaries_old/11disabled_if_in_filelist_same_name/result/rougail/00-base.yml index b7bcc817d..584dabddc 100644 --- a/tests/dictionaries_old/11disabled_if_in_filelist_same_name/result/rougail/00-base.yml +++ b/tests/dictionaries_old/11disabled_if_in_filelist_same_name/result/rougail/00-base.yml @@ -7,13 +7,11 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: boolean description: No change - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/20override/result/services/00-base.yml b/tests/dictionaries_old/20override/result/services/00-base.yml index 57a345144..3cd7d74a5 100644 --- a/tests/dictionaries_old/20override/result/services/00-base.yml +++ b/tests/dictionaries_old/20override/result/services/00-base.yml @@ -1,5 +1,5 @@ test.service: - override: null + override: test2.service: override: engine: jinja diff --git a/tests/dictionaries_old/40condition_base/result/rougail/00-base.yml b/tests/dictionaries_old/40condition_base/result/rougail/00-base.yml index 4219af677..7cb155ef2 100644 --- a/tests/dictionaries_old/40condition_base/result/rougail/00-base.yml +++ b/tests/dictionaries_old/40condition_base/result/rougail/00-base.yml @@ -11,14 +11,12 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/40condition_base_add/result/rougail/00-base.yml b/tests/dictionaries_old/40condition_base_add/result/rougail/00-base.yml index 4219af677..7cb155ef2 100644 --- a/tests/dictionaries_old/40condition_base_add/result/rougail/00-base.yml +++ b/tests/dictionaries_old/40condition_base_add/result/rougail/00-base.yml @@ -11,14 +11,12 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/40condition_fallback/result/rougail/00-base.yml b/tests/dictionaries_old/40condition_fallback/result/rougail/00-base.yml index 5add5d038..9ef28773e 100644 --- a/tests/dictionaries_old/40condition_fallback/result/rougail/00-base.yml +++ b/tests/dictionaries_old/40condition_fallback/result/rougail/00-base.yml @@ -7,22 +7,18 @@ general: type: string description: No change default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if __condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if __condition == "oui" %}disabled{% endif %}' + disabled: *id001 disabled_family: mode_conteneur_actif3: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if __condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/51redefine_remove_condition/result/rougail/00-base.yml b/tests/dictionaries_old/51redefine_remove_condition/result/rougail/00-base.yml index d5870b80a..6c9d47b20 100644 --- a/tests/dictionaries_old/51redefine_remove_condition/result/rougail/00-base.yml +++ b/tests/dictionaries_old/51redefine_remove_condition/result/rougail/00-base.yml @@ -12,14 +12,12 @@ general: description: No change hidden: true default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/51redefine_remove_condition_filelist/result/rougail/00-base.yml b/tests/dictionaries_old/51redefine_remove_condition_filelist/result/rougail/00-base.yml index d5870b80a..6c9d47b20 100644 --- a/tests/dictionaries_old/51redefine_remove_condition_filelist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/51redefine_remove_condition_filelist/result/rougail/00-base.yml @@ -12,14 +12,12 @@ general: description: No change hidden: true default: non - disabled: + disabled: &id001 type: jinja jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' mode_conteneur_actif2: type: string description: No change default: non - disabled: - type: jinja - jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}' + disabled: *id001 version: '1.1' diff --git a/tests/dictionaries_old/51redefine_removecondition_nonautofreeze/result/rougail/00-base.yml b/tests/dictionaries_old/51redefine_removecondition_nonautofreeze/result/rougail/00-base.yml index 81a525ffd..2ec86086c 100644 --- a/tests/dictionaries_old/51redefine_removecondition_nonautofreeze/result/rougail/00-base.yml +++ b/tests/dictionaries_old/51redefine_removecondition_nonautofreeze/result/rougail/00-base.yml @@ -1,18 +1,16 @@ my_var: - default: 'no' + default: no condition: - default: 'no' + default: no my_var1: hidden: true - default: 'no' - disabled: + default: no + disabled: &id001 type: jinja jinja: '{% if rougail.condition == "yes" %}disabled{% endif %}' my_var2: - default: 'no' - disabled: - type: jinja - jinja: '{% if rougail.condition == "yes" %}disabled{% endif %}' + default: no + disabled: *id001 server_deployed: type: boolean hidden: true diff --git a/tests/dictionaries_old/51redefine_validenum/result/rougail/01-redefine.yml b/tests/dictionaries_old/51redefine_validenum/result/rougail/01-redefine.yml index c8a346692..eb205c1ef 100644 --- a/tests/dictionaries_old/51redefine_validenum/result/rougail/01-redefine.yml +++ b/tests/dictionaries_old/51redefine_validenum/result/rougail/01-redefine.yml @@ -1,7 +1,7 @@ general: mode_conteneur_actif: redefine: true - validators: null + validators: default: a choices: - a diff --git a/tests/dictionaries_old/60extra_externalspacecondition/result/rougail/00-base.yml b/tests/dictionaries_old/60extra_externalspacecondition/result/rougail/00-base.yml index 165695cb9..617dd1f31 100644 --- a/tests/dictionaries_old/60extra_externalspacecondition/result/rougail/00-base.yml +++ b/tests/dictionaries_old/60extra_externalspacecondition/result/rougail/00-base.yml @@ -1,10 +1,10 @@ general: description: général my_var: - default: 'no' + default: no my_var1: hidden: true - default: 'no' + default: no server_deployed: type: boolean hidden: true diff --git a/tests/dictionaries_old/70service_disabled/result/rougail/00-base.yml b/tests/dictionaries_old/70service_disabled/result/rougail/00-base.yml index da348e6ff..8fdf4a7fc 100644 --- a/tests/dictionaries_old/70service_disabled/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_disabled/result/rougail/00-base.yml @@ -1,3 +1,3 @@ condition: - default: 'no' + default: no version: '1.1' diff --git a/tests/dictionaries_old/70service_disabled_undisable/result/rougail/00-base.yml b/tests/dictionaries_old/70service_disabled_undisable/result/rougail/00-base.yml index da348e6ff..8fdf4a7fc 100644 --- a/tests/dictionaries_old/70service_disabled_undisable/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_disabled_undisable/result/rougail/00-base.yml @@ -1,3 +1,3 @@ condition: - default: 'no' + default: no version: '1.1' diff --git a/tests/dictionaries_old/70service_servicelist/result/rougail/00-base.yml b/tests/dictionaries_old/70service_servicelist/result/rougail/00-base.yml index da348e6ff..8fdf4a7fc 100644 --- a/tests/dictionaries_old/70service_servicelist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_servicelist/result/rougail/00-base.yml @@ -1,3 +1,3 @@ condition: - default: 'no' + default: no version: '1.1' diff --git a/tests/dictionaries_old/70service_servicelist_disabled_if_in/result/rougail/00-base.yml b/tests/dictionaries_old/70service_servicelist_disabled_if_in/result/rougail/00-base.yml index 97e468f16..5c9bcb348 100644 --- a/tests/dictionaries_old/70service_servicelist_disabled_if_in/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_servicelist_disabled_if_in/result/rougail/00-base.yml @@ -1,7 +1,7 @@ condition1: - default: 'no' + default: no condition2: - default: 'no' + default: no disabled: type: jinja jinja: '{% if rougail.condition1 == "no" %}disabled{% endif %}' diff --git a/tests/dictionaries_old/70service_servicelist_extra/result/extra/00-base.yml b/tests/dictionaries_old/70service_servicelist_extra/result/extra/00-base.yml index da348e6ff..8fdf4a7fc 100644 --- a/tests/dictionaries_old/70service_servicelist_extra/result/extra/00-base.yml +++ b/tests/dictionaries_old/70service_servicelist_extra/result/extra/00-base.yml @@ -1,3 +1,3 @@ condition: - default: 'no' + default: no version: '1.1' diff --git a/tests/dictionaries_old/70service_servicelist_file/result/rougail/00-base.yml b/tests/dictionaries_old/70service_servicelist_file/result/rougail/00-base.yml index e3327d674..b2658fc51 100644 --- a/tests/dictionaries_old/70service_servicelist_file/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_servicelist_file/result/rougail/00-base.yml @@ -1,5 +1,5 @@ condition: - default: 'no' + default: no nut_monitor_host: type: ip mandatory: true diff --git a/tests/dictionaries_old/70service_servicelist_ip/result/rougail/00-base.yml b/tests/dictionaries_old/70service_servicelist_ip/result/rougail/00-base.yml index e3327d674..b2658fc51 100644 --- a/tests/dictionaries_old/70service_servicelist_ip/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_servicelist_ip/result/rougail/00-base.yml @@ -1,5 +1,5 @@ condition: - default: 'no' + default: no nut_monitor_host: type: ip mandatory: true diff --git a/tests/dictionaries_old/70service_servicelist_not_managed/result/rougail/00-base.yml b/tests/dictionaries_old/70service_servicelist_not_managed/result/rougail/00-base.yml index da348e6ff..8fdf4a7fc 100644 --- a/tests/dictionaries_old/70service_servicelist_not_managed/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70service_servicelist_not_managed/result/rougail/00-base.yml @@ -1,3 +1,3 @@ condition: - default: 'no' + default: no version: '1.1' diff --git a/tests/dictionaries_old/70services_ip_iplist/result/rougail/00-base.yml b/tests/dictionaries_old/70services_ip_iplist/result/rougail/00-base.yml index 4579ca9b0..4587d7392 100644 --- a/tests/dictionaries_old/70services_ip_iplist/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70services_ip_iplist/result/rougail/00-base.yml @@ -1,5 +1,5 @@ condition: - default: 'no' + default: no nut_monitor_host: type: network_cidr mandatory: true diff --git a/tests/dictionaries_old/70services_ip_iplist2/result/rougail/00-base.yml b/tests/dictionaries_old/70services_ip_iplist2/result/rougail/00-base.yml index 34d70d4db..4f5e8169a 100644 --- a/tests/dictionaries_old/70services_ip_iplist2/result/rougail/00-base.yml +++ b/tests/dictionaries_old/70services_ip_iplist2/result/rougail/00-base.yml @@ -1,5 +1,5 @@ condition: - default: 'yes' + default: yes nut_monitor_host: type: network_cidr mandatory: true diff --git a/tests/test_1_flattener.py b/tests/test_1_flattener.py index 2df3fac4f..1a2755bc1 100644 --- a/tests/test_1_flattener.py +++ b/tests/test_1_flattener.py @@ -38,10 +38,10 @@ excludes = set([ ]) test_ok -= excludes test_raise -= excludes -test_ok = ['40version_underscode'] +#test_ok = ['01base_shorthand'] #test_ok = [] #test_raise = ['88valid_enum_invalid_default'] -test_raise = [] +#test_raise = [] test_multi = True #test_multi = False diff --git a/tests/test_2_makedict.py b/tests/test_2_makedict.py index 0acddb13e..b0a5c1f95 100644 --- a/tests/test_2_makedict.py +++ b/tests/test_2_makedict.py @@ -29,7 +29,7 @@ excludes = set([ '80valid_enum_variables', ]) -#excludes = set(['01base_file_utfchar']) +excludes = set(['20family_dynamic_variable_outside_sub_suffix']) test_ok -= excludes #test_ok = ['20family_dynamic_static']