diff --git a/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po b/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po index d780f6e..40b51fa 100644 --- a/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po +++ b/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-02-10 09:21+0100\n" -"PO-Revision-Date: 2025-02-10 09:22+0100\n" +"POT-Creation-Date: 2025-04-09 08:34+0200\n" +"PO-Revision-Date: 2025-04-09 08:35+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -27,8 +27,8 @@ msgstr "" "\"{1}\"" #: src/rougail/user_data_yaml/__init__.py:85 -msgid "yaml ({0})" -msgstr "fichier yaml ({0})" +msgid "the YAML file \"{0}\"" +msgstr "le fichier YAML \"{0}\"" #: src/rougail/user_data_yaml/__init__.py:116 msgid "\"{0}\" in {1} has an unknown value" diff --git a/locale/rougail_user_data_yaml.pot b/locale/rougail_user_data_yaml.pot index 1ec1b3d..10d9f0a 100644 --- a/locale/rougail_user_data_yaml.pot +++ b/locale/rougail_user_data_yaml.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-02-10 09:22+0100\n" +"POT-Creation-Date: 2025-04-09 08:48+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,7 +24,7 @@ msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\"" msgstr "" #: src/rougail/user_data_yaml/__init__.py:85 -msgid "yaml ({0})" +msgid "the YAML file \"{0}\"" msgstr "" #: src/rougail/user_data_yaml/__init__.py:116 diff --git a/src/rougail/user_data_yaml/__init__.py b/src/rougail/user_data_yaml/__init__.py index 3f8a170..9082da0 100644 --- a/src/rougail/user_data_yaml/__init__.py +++ b/src/rougail/user_data_yaml/__init__.py @@ -82,7 +82,7 @@ class RougailUserDataYaml: allow_secrets_variables = True user_datas.append( { - "source": _("yaml ({0})").format(filename), + "source": _('the YAML file "{0}"').format(filename), "errors": self.errors, "warnings": self.warnings, "values": values, diff --git a/src/rougail/user_data_yaml/locale/fr/LC_MESSAGES/rougail_user_data_yaml.mo b/src/rougail/user_data_yaml/locale/fr/LC_MESSAGES/rougail_user_data_yaml.mo index 9bb977b..4fdc703 100644 Binary files a/src/rougail/user_data_yaml/locale/fr/LC_MESSAGES/rougail_user_data_yaml.mo and b/src/rougail/user_data_yaml/locale/fr/LC_MESSAGES/rougail_user_data_yaml.mo differ diff --git a/tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml b/tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml new file mode 100644 index 0000000..13596c5 --- /dev/null +++ b/tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml @@ -0,0 +1,5 @@ +{ + "dynVal1": { + "var": "string1" + } +} diff --git a/tests/errors/60_0family_dynamic_upper_char/rougail/00-base.yml b/tests/errors/60_0family_dynamic_upper_char/rougail/00-base.yml new file mode 100644 index 0000000..9c59d73 --- /dev/null +++ b/tests/errors/60_0family_dynamic_upper_char/rougail/00-base.yml @@ -0,0 +1,10 @@ +--- +version: '1.1' + +var: [] # A suffix variable + +"dyn{{ identifier }}": + description: A dynamic family + dynamic: + variable: _.var + var: # A dynamic variable diff --git a/tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml b/tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml new file mode 100644 index 0000000..13596c5 --- /dev/null +++ b/tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml @@ -0,0 +1,5 @@ +{ + "dynVal1": { + "var": "string1" + } +} diff --git a/tests/errors/60_0family_dynamic_upper_char2/rougail/00-base.yml b/tests/errors/60_0family_dynamic_upper_char2/rougail/00-base.yml new file mode 100644 index 0000000..1eca4de --- /dev/null +++ b/tests/errors/60_0family_dynamic_upper_char2/rougail/00-base.yml @@ -0,0 +1,12 @@ +--- +version: '1.1' + +var: #A suffix variable + mandatory: false + default: [] + +"dyn{{ identifier }}": + description: A dynamic family + dynamic: + variable: _.var + var: # A dynamic variable diff --git a/tests/results/00_6secret/file/all.yml b/tests/results/00_6secret/file/all.yml index b175d5a..180ef84 100644 --- a/tests/results/00_6secret/file/all.yml +++ b/tests/results/00_6secret/file/all.yml @@ -1,6 +1,6 @@ { "rougail": { - "secret1": "string1", - "secret2": "string1" + "secret1": "onE7vaLues_len1", + "secret2": "onE7vaLues_len1" } } \ No newline at end of file diff --git a/tests/results/00_6secret/file/all_exclude.yml b/tests/results/00_6secret/file/all_exclude.yml index b175d5a..180ef84 100644 --- a/tests/results/00_6secret/file/all_exclude.yml +++ b/tests/results/00_6secret/file/all_exclude.yml @@ -1,6 +1,6 @@ { "rougail": { - "secret1": "string1", - "secret2": "string1" + "secret1": "onE7vaLues_len1", + "secret2": "onE7vaLues_len1" } } \ No newline at end of file diff --git a/tests/results/00_6secret/file/mandatories.yml b/tests/results/00_6secret/file/mandatories.yml index 3a18595..bac8d06 100644 --- a/tests/results/00_6secret/file/mandatories.yml +++ b/tests/results/00_6secret/file/mandatories.yml @@ -1,5 +1,5 @@ { "rougail": { - "secret1": "string1" + "secret1": "onE7vaLues_len1" } } \ No newline at end of file diff --git a/tests/results/00_6secret/makedict/all.json b/tests/results/00_6secret/makedict/all.json index 6be28b4..20c73a4 100644 --- a/tests/results/00_6secret/makedict/all.json +++ b/tests/results/00_6secret/makedict/all.json @@ -1,4 +1,4 @@ { - "rougail.secret1": "string1", - "rougail.secret2": "string1" + "rougail.secret1": "onE7vaLues_len1", + "rougail.secret2": "onE7vaLues_len1" } diff --git a/tests/results/00_6secret/makedict/mandatories.json b/tests/results/00_6secret/makedict/mandatories.json index 11e2ede..7cd38e7 100644 --- a/tests/results/00_6secret/makedict/mandatories.json +++ b/tests/results/00_6secret/makedict/mandatories.json @@ -1,4 +1,4 @@ { - "rougail.secret1": "string1", + "rougail.secret1": "onE7vaLues_len1", "rougail.secret2": "value" } diff --git a/tests/results/04_1auto_save_and_hidden/errors/all.json b/tests/results/04_1auto_save_and_hidden/errors/all.json index ac35c06..0c9b767 100644 --- a/tests/results/04_1auto_save_and_hidden/errors/all.json +++ b/tests/results/04_1auto_save_and_hidden/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.var\" (autosave variable) because has property \"hidden\"" + "cannot access to option \"rougail.var\" (autosave variable) because has property \"hidden\" loaded from the YAML file \"tests/results/04_1auto_save_and_hidden/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_1default_calculation_hidden/errors/mandatories.json b/tests/results/04_1default_calculation_hidden/errors/mandatories.json index 18ec1de..247ca53 100644 --- a/tests/results/04_1default_calculation_hidden/errors/mandatories.json +++ b/tests/results/04_1default_calculation_hidden/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.var2\" (a second variable) because has property \"disabled\"" + "cannot access to option \"rougail.var2\" (a second variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_1default_calculation_hidden/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_1default_calculation_hidden_2/errors/mandatories.json b/tests/results/04_1default_calculation_hidden_2/errors/mandatories.json index 18ec1de..b8cefa8 100644 --- a/tests/results/04_1default_calculation_hidden_2/errors/mandatories.json +++ b/tests/results/04_1default_calculation_hidden_2/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.var2\" (a second variable) because has property \"disabled\"" + "cannot access to option \"rougail.var2\" (a second variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_1default_calculation_hidden_2/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_optional/errors/all.json b/tests/results/04_5disabled_calculation_optional/errors/all.json index 7d84b6a..1875b9d 100644 --- a/tests/results/04_5disabled_calculation_optional/errors/all.json +++ b/tests/results/04_5disabled_calculation_optional/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.var1\" (a first variable) because has property \"hidden\" (unknown is undefined)" + "cannot access to option \"rougail.var1\" (a first variable) because has property \"hidden\" (unknown is undefined) loaded from the YAML file \"tests/results/04_5disabled_calculation_optional/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable/errors/all.json b/tests/results/04_5disabled_calculation_variable/errors/all.json index 2794cdf..7112b5c 100644 --- a/tests/results/04_5disabled_calculation_variable/errors/all.json +++ b/tests/results/04_5disabled_calculation_variable/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_5disabled_calculation_variable/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable2/errors/all.json b/tests/results/04_5disabled_calculation_variable2/errors/all.json index 2794cdf..2333eef 100644 --- a/tests/results/04_5disabled_calculation_variable2/errors/all.json +++ b/tests/results/04_5disabled_calculation_variable2/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_5disabled_calculation_variable2/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable2/errors/mandatories.json b/tests/results/04_5disabled_calculation_variable2/errors/mandatories.json index 2794cdf..0845ea0 100644 --- a/tests/results/04_5disabled_calculation_variable2/errors/mandatories.json +++ b/tests/results/04_5disabled_calculation_variable2/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_5disabled_calculation_variable2/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable3/errors/mandatories.json b/tests/results/04_5disabled_calculation_variable3/errors/mandatories.json index 2794cdf..cb58956 100644 --- a/tests/results/04_5disabled_calculation_variable3/errors/mandatories.json +++ b/tests/results/04_5disabled_calculation_variable3/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_5disabled_calculation_variable3/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable4/errors/all.json b/tests/results/04_5disabled_calculation_variable4/errors/all.json index 2794cdf..c9e2293 100644 --- a/tests/results/04_5disabled_calculation_variable4/errors/all.json +++ b/tests/results/04_5disabled_calculation_variable4/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_5disabled_calculation_variable4/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable_multi/errors/all.json b/tests/results/04_5disabled_calculation_variable_multi/errors/all.json index 2794cdf..64be218 100644 --- a/tests/results/04_5disabled_calculation_variable_multi/errors/all.json +++ b/tests/results/04_5disabled_calculation_variable_multi/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"disabled\" loaded from the YAML file \"tests/results/04_5disabled_calculation_variable_multi/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/04_5hidden_calculation2/errors/all.json b/tests/results/04_5hidden_calculation2/errors/all.json index 60dc26f..ed0021d 100644 --- a/tests/results/04_5hidden_calculation2/errors/all.json +++ b/tests/results/04_5hidden_calculation2/errors/all.json @@ -1,7 +1,7 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.var1\" (a first variable) because has property \"hidden\" (condition is yes)", - "cannot access to option \"rougail.var2\" (a second variable) because has property \"hidden\" (condition is yes)" + "cannot access to option \"rougail.var1\" (a first variable) because has property \"hidden\" (condition is yes) loaded from the YAML file \"tests/results/04_5hidden_calculation2/file/all.yml\"", + "cannot access to option \"rougail.var2\" (a second variable) because has property \"hidden\" (condition is yes) loaded from the YAML file \"tests/results/04_5hidden_calculation2/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/16_2family_redefine_calculation/errors/all.json b/tests/results/16_2family_redefine_calculation/errors/all.json index 8e0bee7..bb6696e 100644 --- a/tests/results/16_2family_redefine_calculation/errors/all.json +++ b/tests/results/16_2family_redefine_calculation/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" (true)" + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" (true) loaded from the YAML file \"tests/results/16_2family_redefine_calculation/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/16_2family_redefine_calculation/errors/mandatories.json b/tests/results/16_2family_redefine_calculation/errors/mandatories.json index 8e0bee7..d0c890a 100644 --- a/tests/results/16_2family_redefine_calculation/errors/mandatories.json +++ b/tests/results/16_2family_redefine_calculation/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" (true)" + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" (true) loaded from the YAML file \"tests/results/16_2family_redefine_calculation/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/16_2family_redefine_disabled/errors/all.json b/tests/results/16_2family_redefine_disabled/errors/all.json index 81c952d..502a4ef 100644 --- a/tests/results/16_2family_redefine_disabled/errors/all.json +++ b/tests/results/16_2family_redefine_disabled/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\"" + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" loaded from the YAML file \"tests/results/16_2family_redefine_disabled/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/16_2family_redefine_disabled/errors/mandatories.json b/tests/results/16_2family_redefine_disabled/errors/mandatories.json index 81c952d..78bc7ea 100644 --- a/tests/results/16_2family_redefine_disabled/errors/mandatories.json +++ b/tests/results/16_2family_redefine_disabled/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\"" + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" loaded from the YAML file \"tests/results/16_2family_redefine_disabled/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/16_5exists_redefine/errors/all.json b/tests/results/16_5exists_redefine/errors/all.json index 29ad9cb..2c4cf85 100644 --- a/tests/results/16_5exists_redefine/errors/all.json +++ b/tests/results/16_5exists_redefine/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.var1\" (a first variable) because has property \"hidden\"" + "cannot access to option \"rougail.var1\" (a first variable) because has property \"hidden\" loaded from the YAML file \"tests/results/16_5exists_redefine/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/16_5redefine_hidden/errors/all.json b/tests/results/16_5redefine_hidden/errors/all.json index c6e4368..18a5374 100644 --- a/tests/results/16_5redefine_hidden/errors/all.json +++ b/tests/results/16_5redefine_hidden/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.variable\" (a variable) because has property \"hidden\"" + "cannot access to option \"rougail.variable\" (a variable) because has property \"hidden\" loaded from the YAML file \"tests/results/16_5redefine_hidden/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/17_5redefine_leadership/errors/all.json b/tests/results/17_5redefine_leadership/errors/all.json index 5bcc277..93d5350 100644 --- a/tests/results/17_5redefine_leadership/errors/all.json +++ b/tests/results/17_5redefine_leadership/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\"" + "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\" loaded from the YAML file \"tests/results/17_5redefine_leadership/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/20_0family_underscore/errors/all.json b/tests/results/20_0family_underscore/errors/all.json index 647a966..005d407 100644 --- a/tests/results/20_0family_underscore/errors/all.json +++ b/tests/results/20_0family_underscore/errors/all.json @@ -1,11 +1,11 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\"", - "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\"", - "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\"", - "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\"", - "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\"", - "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\"" + "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\" loaded from the YAML file \"tests/results/20_0family_underscore/file/all.yml\"", + "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\" loaded from the YAML file \"tests/results/20_0family_underscore/file/all.yml\"", + "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\" loaded from the YAML file \"tests/results/20_0family_underscore/file/all.yml\"", + "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\" loaded from the YAML file \"tests/results/20_0family_underscore/file/all.yml\"", + "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\" loaded from the YAML file \"tests/results/20_0family_underscore/file/all.yml\"", + "cannot access to optiondescription \"rougail.my_family\" (This is a great family) because has properties \"disabled\" and \"hidden\" loaded from the YAML file \"tests/results/20_0family_underscore/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/24_0family_hidden_condition_variable_sub_family/errors/all.json b/tests/results/24_0family_hidden_condition_variable_sub_family/errors/all.json index 8256a24..ac850d2 100644 --- a/tests/results/24_0family_hidden_condition_variable_sub_family/errors/all.json +++ b/tests/results/24_0family_hidden_condition_variable_sub_family/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" (possibly hidden family) because has property \"hidden\"" + "cannot access to optiondescription \"rougail.family\" (possibly hidden family) because has property \"hidden\" loaded from the YAML file \"tests/results/24_0family_hidden_condition_variable_sub_family/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/24_0family_hidden_condition_with_variable/errors/all.json b/tests/results/24_0family_hidden_condition_with_variable/errors/all.json index fb3b8fb..b031a7f 100644 --- a/tests/results/24_0family_hidden_condition_with_variable/errors/all.json +++ b/tests/results/24_0family_hidden_condition_with_variable/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.family.variable\" (a variable) because has property \"hidden\" (condition2 is true)" + "cannot access to option \"rougail.family.variable\" (a variable) because has property \"hidden\" (condition2 is true) loaded from the YAML file \"tests/results/24_0family_hidden_condition_with_variable/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/24_family_disabled_var_hidden/errors/all.json b/tests/results/24_family_disabled_var_hidden/errors/all.json index ab6030d..9233448 100644 --- a/tests/results/24_family_disabled_var_hidden/errors/all.json +++ b/tests/results/24_family_disabled_var_hidden/errors/all.json @@ -1,7 +1,7 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\"", - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\"" + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" loaded from the YAML file \"tests/results/24_family_disabled_var_hidden/file/all.yml\"", + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" loaded from the YAML file \"tests/results/24_family_disabled_var_hidden/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/24_family_disabled_var_hidden/errors/mandatories.json b/tests/results/24_family_disabled_var_hidden/errors/mandatories.json index 81c952d..f6658b3 100644 --- a/tests/results/24_family_disabled_var_hidden/errors/mandatories.json +++ b/tests/results/24_family_disabled_var_hidden/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" because has property \"disabled\"" + "cannot access to optiondescription \"rougail.family\" because has property \"disabled\" loaded from the YAML file \"tests/results/24_family_disabled_var_hidden/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/40_2leadership_calculation_index/file/mandatories.yml b/tests/results/40_2leadership_calculation_index/file/mandatories.yml index 56ebac8..9e26dfe 100644 --- a/tests/results/40_2leadership_calculation_index/file/mandatories.yml +++ b/tests/results/40_2leadership_calculation_index/file/mandatories.yml @@ -1,9 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_2leadership_calculation_param_index/file/mandatories.yml b/tests/results/40_2leadership_calculation_param_index/file/mandatories.yml index 56ebac8..9e26dfe 100644 --- a/tests/results/40_2leadership_calculation_param_index/file/mandatories.yml +++ b/tests/results/40_2leadership_calculation_param_index/file/mandatories.yml @@ -1,9 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_9leadership-calculation-outside-follower-first/file/mandatories.yml b/tests/results/40_9leadership-calculation-outside-follower-first/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/40_9leadership-calculation-outside-follower-first/file/mandatories.yml +++ b/tests/results/40_9leadership-calculation-outside-follower-first/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_9leadership-calculation-outside-follower-last/file/mandatories.yml b/tests/results/40_9leadership-calculation-outside-follower-last/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/40_9leadership-calculation-outside-follower-last/file/mandatories.yml +++ b/tests/results/40_9leadership-calculation-outside-follower-last/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_9leadership-calculation-outside-follower/file/mandatories.yml b/tests/results/40_9leadership-calculation-outside-follower/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/40_9leadership-calculation-outside-follower/file/mandatories.yml +++ b/tests/results/40_9leadership-calculation-outside-follower/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_9leadership-calculation-outside-leader-first/file/mandatories.yml b/tests/results/40_9leadership-calculation-outside-leader-first/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/40_9leadership-calculation-outside-leader-first/file/mandatories.yml +++ b/tests/results/40_9leadership-calculation-outside-leader-first/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_9leadership-calculation-outside-leader-last/file/mandatories.yml b/tests/results/40_9leadership-calculation-outside-leader-last/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/40_9leadership-calculation-outside-leader-last/file/mandatories.yml +++ b/tests/results/40_9leadership-calculation-outside-leader-last/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/40_9leadership-calculation-outside-leader/file/mandatories.yml b/tests/results/40_9leadership-calculation-outside-leader/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/40_9leadership-calculation-outside-leader/file/mandatories.yml +++ b/tests/results/40_9leadership-calculation-outside-leader/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/44_0leadership_hidden/errors/all.json b/tests/results/44_0leadership_hidden/errors/all.json index 5bcc277..80ac393 100644 --- a/tests/results/44_0leadership_hidden/errors/all.json +++ b/tests/results/44_0leadership_hidden/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\"" + "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\" loaded from the YAML file \"tests/results/44_0leadership_hidden/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/44_0leadership_leader_hidden/errors/all.json b/tests/results/44_0leadership_leader_hidden/errors/all.json index 5bcc277..9619f76 100644 --- a/tests/results/44_0leadership_leader_hidden/errors/all.json +++ b/tests/results/44_0leadership_leader_hidden/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\"" + "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\" loaded from the YAML file \"tests/results/44_0leadership_leader_hidden/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/44_1leadership_append_hidden_follower/errors/all.json b/tests/results/44_1leadership_append_hidden_follower/errors/all.json index 5bcc277..171212f 100644 --- a/tests/results/44_1leadership_append_hidden_follower/errors/all.json +++ b/tests/results/44_1leadership_append_hidden_follower/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\"" + "cannot access to optiondescription \"rougail.leader\" (a leadership) because has property \"hidden\" loaded from the YAML file \"tests/results/44_1leadership_append_hidden_follower/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/44_6leadership_follower_disabled_calculation/errors/mandatories.json b/tests/results/44_6leadership_follower_disabled_calculation/errors/mandatories.json index 9274a54..be22df6 100644 --- a/tests/results/44_6leadership_follower_disabled_calculation/errors/mandatories.json +++ b/tests/results/44_6leadership_follower_disabled_calculation/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.leader.follower\" (a follower) because has property \"disabled\" (disabled)" + "cannot access to option \"rougail.leader.follower\" (a follower) because has property \"disabled\" (disabled) loaded from the YAML file \"tests/results/44_6leadership_follower_disabled_calculation/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/44_9calculated_default_leadership_leader/file/mandatories.yml b/tests/results/44_9calculated_default_leadership_leader/file/mandatories.yml index 05de840..9e26dfe 100644 --- a/tests/results/44_9calculated_default_leadership_leader/file/mandatories.yml +++ b/tests/results/44_9calculated_default_leadership_leader/file/mandatories.yml @@ -1,8 +1 @@ -{ - "rougail": { - "leader": [ - {}, - {} - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/tests/results/60_0family_dynamic_upper_char/errors/all.json b/tests/results/60_0family_dynamic_upper_char/errors/all.json new file mode 100644 index 0000000..217db0a --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/errors/all.json @@ -0,0 +1,4 @@ +{ + "errors": [], + "warnings": [] +} \ No newline at end of file diff --git a/tests/results/60_0family_dynamic_upper_char/errors/mandatories.json b/tests/results/60_0family_dynamic_upper_char/errors/mandatories.json new file mode 100644 index 0000000..217db0a --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/errors/mandatories.json @@ -0,0 +1,4 @@ +{ + "errors": [], + "warnings": [] +} \ No newline at end of file diff --git a/tests/results/60_0family_dynamic_upper_char/file/all.yml b/tests/results/60_0family_dynamic_upper_char/file/all.yml new file mode 100644 index 0000000..0511a7c --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/file/all.yml @@ -0,0 +1,14 @@ +{ + "rougail": { + "var": [ + "Val1", + "VAL2" + ], + "dynval1": { + "var": "string1" + }, + "dynval2": { + "var": "string1" + } + } +} \ No newline at end of file diff --git a/tests/results/60_0family_dynamic_upper_char/file/all_exclude.yml b/tests/results/60_0family_dynamic_upper_char/file/all_exclude.yml new file mode 100644 index 0000000..6a6fba0 --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/file/all_exclude.yml @@ -0,0 +1,10 @@ +{ + "rougail": { + "dynval1": { + "var": "string1" + }, + "dynval2": { + "var": "string1" + } + } +} \ No newline at end of file diff --git a/tests/results/60_0family_dynamic_upper_char/file/mandatories.yml b/tests/results/60_0family_dynamic_upper_char/file/mandatories.yml new file mode 100644 index 0000000..6a6fba0 --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/file/mandatories.yml @@ -0,0 +1,10 @@ +{ + "rougail": { + "dynval1": { + "var": "string1" + }, + "dynval2": { + "var": "string1" + } + } +} \ No newline at end of file diff --git a/tests/results/60_0family_dynamic_upper_char/makedict/all.json b/tests/results/60_0family_dynamic_upper_char/makedict/all.json new file mode 100644 index 0000000..a90831a --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/makedict/all.json @@ -0,0 +1,8 @@ +{ + "rougail.var": [ + "Val1", + "VAL2" + ], + "rougail.dynval1.var": "string1", + "rougail.dynval2.var": "string1" +} diff --git a/tests/results/60_0family_dynamic_upper_char/makedict/mandatories.json b/tests/results/60_0family_dynamic_upper_char/makedict/mandatories.json new file mode 100644 index 0000000..a90831a --- /dev/null +++ b/tests/results/60_0family_dynamic_upper_char/makedict/mandatories.json @@ -0,0 +1,8 @@ +{ + "rougail.var": [ + "Val1", + "VAL2" + ], + "rougail.dynval1.var": "string1", + "rougail.dynval2.var": "string1" +} diff --git a/tests/results/60_0family_hidden/errors/all.json b/tests/results/60_0family_hidden/errors/all.json index 8c7886d..068b7b5 100644 --- a/tests/results/60_0family_hidden/errors/all.json +++ b/tests/results/60_0family_hidden/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.family\" (a family) because has property \"hidden\"" + "cannot access to optiondescription \"rougail.family\" (a family) because has property \"hidden\" loaded from the YAML file \"tests/results/60_0family_hidden/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/all.json b/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/all.json index ed5d5aa..2e3b8f7 100644 --- a/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/all.json +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/all.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.dynval1.var\" (A dynamic variable) because has property \"disabled\"" + "cannot access to option \"rougail.dynval1.var\" (A dynamic variable) because has property \"disabled\" loaded from the YAML file \"tests/results/60_5family_dynamic_calc_suffix_disabled/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/mandatories.json b/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/mandatories.json index ed5d5aa..079486d 100644 --- a/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/mandatories.json +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled/errors/mandatories.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.dynval1.var\" (A dynamic variable) because has property \"disabled\"" + "cannot access to option \"rougail.dynval1.var\" (A dynamic variable) because has property \"disabled\" loaded from the YAML file \"tests/results/60_5family_dynamic_calc_suffix_disabled/file/mandatories.yml\"" ] } \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/all.json b/tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/all.json new file mode 100644 index 0000000..be1cd71 --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/all.json @@ -0,0 +1,7 @@ +{ + "errors": [], + "warnings": [ + "cannot access to option \"rougail.dynval1.var\" (A dynamic variable) because has property \"disabled\" loaded from the YAML file \"tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all.yml\"", + "cannot access to option \"rougail.dynval2.var\" (A dynamic variable) because has property \"disabled\" loaded from the YAML file \"tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all.yml\"" + ] +} \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/mandatories.json b/tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/mandatories.json new file mode 100644 index 0000000..217db0a --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/mandatories.json @@ -0,0 +1,4 @@ +{ + "errors": [], + "warnings": [] +} \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all.yml b/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all.yml new file mode 100644 index 0000000..c2b7777 --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all.yml @@ -0,0 +1,15 @@ +{ + "rougail": { + "var1": [ + "val1", + "val2" + ], + "dynval1": { + "var": "string1" + }, + "dynval2": { + "var": "string1" + }, + "var2": "string1" + } +} \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all_exclude.yml b/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all_exclude.yml new file mode 100644 index 0000000..ad42f42 --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all_exclude.yml @@ -0,0 +1,11 @@ +{ + "rougail": { + "dynval1": { + "var": "string1" + }, + "dynval2": { + "var": "string1" + }, + "var2": "string1" + } +} \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/mandatories.yml b/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/mandatories.yml new file mode 100644 index 0000000..4d51b74 --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/file/mandatories.yml @@ -0,0 +1,5 @@ +{ + "rougail": { + "var2": "string1" + } +} \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/all.json b/tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/all.json new file mode 100644 index 0000000..32ce3c8 --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/all.json @@ -0,0 +1,7 @@ +{ + "rougail.var1": [ + "val1", + "val2" + ], + "rougail.var2": "string1" +} diff --git a/tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/mandatories.json b/tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/mandatories.json new file mode 100644 index 0000000..9cc7b99 --- /dev/null +++ b/tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/mandatories.json @@ -0,0 +1,4 @@ +{ + "rougail.var1": [], + "rougail.var2": "string1" +} diff --git a/tests/results/60_5family_dynamic_hidden_suffix/errors/all.json b/tests/results/60_5family_dynamic_hidden_suffix/errors/all.json index bedd985..657d339 100644 --- a/tests/results/60_5family_dynamic_hidden_suffix/errors/all.json +++ b/tests/results/60_5family_dynamic_hidden_suffix/errors/all.json @@ -1,7 +1,7 @@ { "errors": [], "warnings": [ - "cannot access to optiondescription \"rougail.dynval2\" (a dynamic family) because has property \"hidden\" (disabled)", - "cannot access to optiondescription \"rougail.dynval2\" (a dynamic family) because has property \"hidden\" (disabled)" + "cannot access to optiondescription \"rougail.dynval2\" (a dynamic family) because has property \"hidden\" (disabled) loaded from the YAML file \"tests/results/60_5family_dynamic_hidden_suffix/file/all.yml\"", + "cannot access to optiondescription \"rougail.dynval2\" (a dynamic family) because has property \"hidden\" (disabled) loaded from the YAML file \"tests/results/60_5family_dynamic_hidden_suffix/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/results/60_5family_dynamic_unknown_suffix/errors/all.json b/tests/results/60_5family_dynamic_unknown_suffix/errors/all.json index 25a4e68..066ad5c 100644 --- a/tests/results/60_5family_dynamic_unknown_suffix/errors/all.json +++ b/tests/results/60_5family_dynamic_unknown_suffix/errors/all.json @@ -1,7 +1,7 @@ { "errors": [], "warnings": [ - "cannot access to option \"rougail.val1_dyn.var4\" (a variable 4) because has property \"disabled\" (val4 is not a valid value)", - "cannot access to option \"rougail.val2_dyn.var4\" (a variable 4) because has property \"disabled\" (val4 is not a valid value)" + "cannot access to option \"rougail.val1_dyn.var4\" (a variable 4) because has property \"disabled\" (val4 is not a valid value) loaded from the YAML file \"tests/results/60_5family_dynamic_unknown_suffix/file/all.yml\"", + "cannot access to option \"rougail.val2_dyn.var4\" (a variable 4) because has property \"disabled\" (val4 is not a valid value) loaded from the YAML file \"tests/results/60_5family_dynamic_unknown_suffix/file/all.yml\"" ] } \ No newline at end of file diff --git a/tests/test_load.py b/tests/test_load.py index 83cc6fc..a019a25 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -4,7 +4,7 @@ from pathlib import Path from rougail import Rougail ######################### from rougail.user_data_yaml import RougailUserDataYaml as RougailUserData -from json import load, dump +from json import load, dump, loads, dumps from ruamel.yaml import YAML ######################### @@ -20,7 +20,7 @@ excludes = [ ] test_ok = get_structures_list(excludes) -# test_ok = [Path('../rougail-tests/structures/60_9extra_dynamic')] +# test_ok = [Path('../rougail-tests/structures/60_6family_dynamic_sub_dynamic_empty')] def idfn(fixture_value): @@ -65,6 +65,8 @@ def _test_dictionaries(test_dir, namespace, ext, *, level, need_exclude=False): expected = load(json_file) # here is the effective test errors_file = Path('tests') / 'results' / test_dir.name / 'errors' / f'{level}.json' + if need_exclude: + errors = loads(dumps(errors).replace('all_exclude.yml', 'all.yml')) if not errors_file.is_file(): errors_file.parent.mkdir(parents=True, exist_ok=True) with open(errors_file, 'a') as json_file: @@ -115,3 +117,42 @@ def test_dictionaries_all_exclude(test_dir): def test_dictionaries_mandatories(test_dir): "tests the output" _test_dictionaries(test_dir, True, EXT, level='mandatories') + + +def test_errors(): + rougailconfig = get_rougail_config(Path('tests/errors/60_0family_dynamic_upper_char'), False) + ################################## + rougailconfig['step.user_data'] = ['yaml'] + rougailconfig['yaml.filename'] = ['tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml'] + ################################## + rougail = Rougail(rougailconfig) + config = rougail.run() + generated_user_data = RougailUserData(config, rougailconfig=rougailconfig).run() + errors = rougail.user_datas(generated_user_data) + assert errors == {'errors': [], 'warnings': [ + 'cannot load variable path "dynVal1.var", the identifier "Val1" is not ' + 'valid in the YAML file ' + '"tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml"', + 'cannot find "dynVal1" loaded from the YAML file ' + '"tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml"', + ]} + + +def test_errors_2(): + rougailconfig = get_rougail_config(Path('tests/errors/60_0family_dynamic_upper_char2'), False) + ################################## + rougailconfig['step.user_data'] = ['yaml'] + rougailconfig['yaml.filename'] = ['tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml'] + ################################## + rougail = Rougail(rougailconfig) + config = rougail.run() + generated_user_data = RougailUserData(config, rougailconfig=rougailconfig).run() + errors = rougail.user_datas(generated_user_data) + assert errors == {'errors': [], 'warnings': [ + 'cannot load variable path "dynVal1.var", the identifier "Val1" is not ' + 'valid in the YAML file ' + '"tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml"', + 'cannot find "dynVal1" loaded from the YAML file ' + '"tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml"', + ]} + ##################################