diff --git a/src/rougail/user_data_yaml/__init__.py b/src/rougail/user_data_yaml/__init__.py index 12b304e..ca3d462 100644 --- a/src/rougail/user_data_yaml/__init__.py +++ b/src/rougail/user_data_yaml/__init__.py @@ -1,6 +1,6 @@ """ Silique (https://www.silique.fr) -Copyright (C) 2024-2025 +Copyright (C) 2024-2026 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/src/rougail/user_data_yaml/config.py b/src/rougail/user_data_yaml/config.py index 4530ada..cd09f62 100644 --- a/src/rougail/user_data_yaml/config.py +++ b/src/rougail/user_data_yaml/config.py @@ -2,7 +2,7 @@ Config yaml for Rougail-user-data Silique (https://www.silique.fr) -Copyright (C) 2024-2025 +Copyright (C) 2024-2026 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/src/rougail/user_data_yaml/i18n.py b/src/rougail/user_data_yaml/i18n.py index 9e46297..fc0a21f 100644 --- a/src/rougail/user_data_yaml/i18n.py +++ b/src/rougail/user_data_yaml/i18n.py @@ -1,6 +1,6 @@ """Internationalisation utilities Silique (https://www.silique.fr) -Copyright (C) 2024-2025 +Copyright (C) 2024-2026 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/tests/errors/results/00_unknown_variable.yaml b/tests/errors/results/00_unknown_variable.yaml index 0bb4ffc..762e8ae 100644 --- a/tests/errors/results/00_unknown_variable.yaml +++ b/tests/errors/results/00_unknown_variable.yaml @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "variable or family \"unknown\" does not exist, it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/00_unknown_variable.yaml\"" + "variable or family \"unknown\" does not exist so cannot load \"unknown\", it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/00_unknown_variable.yaml\"" ] } \ No newline at end of file diff --git a/tests/errors/results/05_value_family.yaml b/tests/errors/results/05_value_family.yaml index 1b0be38..7c71a36 100644 --- a/tests/errors/results/05_value_family.yaml +++ b/tests/errors/results/05_value_family.yaml @@ -3,7 +3,7 @@ "warnings": [ [ [ - "is a family so we cannot set the value \"test\", it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/05_value_family.yaml\"", + "it's a family so we cannot set the value \"test\", it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/05_value_family.yaml\"", "family", null ] diff --git a/tests/errors/results/06_dynamic_unknown.yaml b/tests/errors/results/06_dynamic_unknown.yaml index 5db9612..dd24a8d 100644 --- a/tests/errors/results/06_dynamic_unknown.yaml +++ b/tests/errors/results/06_dynamic_unknown.yaml @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "variable or family \"dyn_unknown\" does not exist, it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/06_dynamic_unknown.yaml\"" + "variable or family \"dyn_unknown\" does not exist so cannot load \"dyn_unknown.variable\", it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/06_dynamic_unknown.yaml\"" ] } \ No newline at end of file diff --git a/tests/errors/results/07_leadership_unknown.yaml b/tests/errors/results/07_leadership_unknown.yaml index f84c019..5fa8f53 100644 --- a/tests/errors/results/07_leadership_unknown.yaml +++ b/tests/errors/results/07_leadership_unknown.yaml @@ -1,6 +1,12 @@ { "errors": [], "warnings": [ - "variable or family \"leadership.unknwon\" does not exist, it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/07_leadership_unknown.yaml\"" + [ + [ + "variable or family \"unknwon\" does not exist so cannot load \"leadership.unknwon\", it will be ignored when loading from the YAML file \"/home/gnunux/git/stove/rougail-user-data-yaml/tests/errors/yaml/07_leadership_unknown.yaml\"", + "leadership", + null + ] + ] ] } \ No newline at end of file diff --git a/tests/invalid/results/invalid_family/errors.json b/tests/invalid/results/invalid_family/errors.json index 587c8a4..27b3401 100644 --- a/tests/invalid/results/invalid_family/errors.json +++ b/tests/invalid/results/invalid_family/errors.json @@ -3,7 +3,7 @@ "warnings": [ [ [ - "is a family so we cannot set the value \"oups\", it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", + "it's a family so we cannot set the value \"oups\", it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", "a_family", null ] diff --git a/tests/invalid/results/invalid_family_invalid/errors.json b/tests/invalid/results/invalid_family_invalid/errors.json index 180ef61..a202fce 100644 --- a/tests/invalid/results/invalid_family_invalid/errors.json +++ b/tests/invalid/results/invalid_family_invalid/errors.json @@ -2,7 +2,7 @@ "errors": [ [ [ - "is a family so we cannot set the value \"oups\", it has been loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", + "it's a family so we cannot set the value \"oups\", it has been loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", "a_family", null ] diff --git a/tests/invalid/results/invalid_family_invalid_unknown/errors.json b/tests/invalid/results/invalid_family_invalid_unknown/errors.json index 180ef61..a202fce 100644 --- a/tests/invalid/results/invalid_family_invalid_unknown/errors.json +++ b/tests/invalid/results/invalid_family_invalid_unknown/errors.json @@ -2,7 +2,7 @@ "errors": [ [ [ - "is a family so we cannot set the value \"oups\", it has been loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", + "it's a family so we cannot set the value \"oups\", it has been loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", "a_family", null ] diff --git a/tests/invalid/results/invalid_family_unknown/errors.json b/tests/invalid/results/invalid_family_unknown/errors.json index 587c8a4..27b3401 100644 --- a/tests/invalid/results/invalid_family_unknown/errors.json +++ b/tests/invalid/results/invalid_family_unknown/errors.json @@ -3,7 +3,7 @@ "warnings": [ [ [ - "is a family so we cannot set the value \"oups\", it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", + "it's a family so we cannot set the value \"oups\", it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\"", "a_family", null ] diff --git a/tests/invalid/results/invalid_multi2/errors.json b/tests/invalid/results/invalid_multi2/errors.json index 5a6ce37..1e11e13 100644 --- a/tests/invalid/results/invalid_multi2/errors.json +++ b/tests/invalid/results/invalid_multi2/errors.json @@ -3,7 +3,7 @@ "warnings": [ [ [ - "the value \"[True]\" is an invalid boolean, it must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", + "the value \"True\" is an invalid boolean, it must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", "a_family.a_boolean", null ] diff --git a/tests/invalid/results/invalid_multi2_invalid/errors.json b/tests/invalid/results/invalid_multi2_invalid/errors.json index 7c6660c..deb3cf6 100644 --- a/tests/invalid/results/invalid_multi2_invalid/errors.json +++ b/tests/invalid/results/invalid_multi2_invalid/errors.json @@ -2,7 +2,7 @@ "errors": [ [ [ - "the value \"[True]\" is an invalid boolean, it must not be a list, it has been loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", + "the value \"True\" is an invalid boolean, it must not be a list, it has been loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", "a_family.a_boolean", null ] diff --git a/tests/invalid/results/invalid_multi2_invalid_unknown/errors.json b/tests/invalid/results/invalid_multi2_invalid_unknown/errors.json index 7c6660c..deb3cf6 100644 --- a/tests/invalid/results/invalid_multi2_invalid_unknown/errors.json +++ b/tests/invalid/results/invalid_multi2_invalid_unknown/errors.json @@ -2,7 +2,7 @@ "errors": [ [ [ - "the value \"[True]\" is an invalid boolean, it must not be a list, it has been loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", + "the value \"True\" is an invalid boolean, it must not be a list, it has been loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", "a_family.a_boolean", null ] diff --git a/tests/invalid/results/invalid_multi2_unknown/errors.json b/tests/invalid/results/invalid_multi2_unknown/errors.json index 5a6ce37..1e11e13 100644 --- a/tests/invalid/results/invalid_multi2_unknown/errors.json +++ b/tests/invalid/results/invalid_multi2_unknown/errors.json @@ -3,7 +3,7 @@ "warnings": [ [ [ - "the value \"[True]\" is an invalid boolean, it must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", + "the value \"True\" is an invalid boolean, it must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\"", "a_family.a_boolean", null ] diff --git a/tests/invalid/results/unknown/errors.json b/tests/invalid/results/unknown/errors.json index 1d1b293..9392218 100644 --- a/tests/invalid/results/unknown/errors.json +++ b/tests/invalid/results/unknown/errors.json @@ -1,6 +1,12 @@ { "errors": [], "warnings": [ - "variable or family \"a_family.unknown\" does not exist, it will be ignored when loading from the YAML file \"tests/invalid/unknown/00.yml\"" + [ + [ + "variable or family \"unknown\" does not exist so cannot load \"a_family.unknown\", it will be ignored when loading from the YAML file \"tests/invalid/unknown/00.yml\"", + "a_family", + null + ] + ] ] } \ No newline at end of file diff --git a/tests/invalid/results/unknown2/errors.json b/tests/invalid/results/unknown2/errors.json index 9d61734..629c3c3 100644 --- a/tests/invalid/results/unknown2/errors.json +++ b/tests/invalid/results/unknown2/errors.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "variable or family \"an_unkown_family\" does not exist, it will be ignored when loading from the YAML file \"tests/invalid/unknown2/00.yml\"" + "variable or family \"an_unkown_family\" does not exist so cannot load \"an_unkown_family.unknown\", it will be ignored when loading from the YAML file \"tests/invalid/unknown2/00.yml\"" ] } \ No newline at end of file diff --git a/tests/invalid/results/unknown2_invalid/errors.json b/tests/invalid/results/unknown2_invalid/errors.json index 113ed4f..629c3c3 100644 --- a/tests/invalid/results/unknown2_invalid/errors.json +++ b/tests/invalid/results/unknown2_invalid/errors.json @@ -1,6 +1,6 @@ { "errors": [], "warnings": [ - "variable or family \"an_unkown_family\" does not exist, it has been loading from the YAML file \"tests/invalid/unknown2/00.yml\"" + "variable or family \"an_unkown_family\" does not exist so cannot load \"an_unkown_family.unknown\", it will be ignored when loading from the YAML file \"tests/invalid/unknown2/00.yml\"" ] } \ No newline at end of file diff --git a/tests/invalid/results/unknown2_invalid_unknown/errors.json b/tests/invalid/results/unknown2_invalid_unknown/errors.json index 447c0f4..c560e5f 100644 --- a/tests/invalid/results/unknown2_invalid_unknown/errors.json +++ b/tests/invalid/results/unknown2_invalid_unknown/errors.json @@ -1,6 +1,6 @@ { "errors": [ - "variable or family \"an_unkown_family\" does not exist, it has been loading from the YAML file \"tests/invalid/unknown2/00.yml\"" + "variable or family \"an_unkown_family\" does not exist so cannot load \"an_unkown_family.unknown\", it has been loading from the YAML file \"tests/invalid/unknown2/00.yml\"" ], "warnings": [] } \ No newline at end of file diff --git a/tests/invalid/results/unknown2_unknown/errors.json b/tests/invalid/results/unknown2_unknown/errors.json index 6128127..c560e5f 100644 --- a/tests/invalid/results/unknown2_unknown/errors.json +++ b/tests/invalid/results/unknown2_unknown/errors.json @@ -1,6 +1,6 @@ { "errors": [ - "variable or family \"an_unkown_family\" does not exist, it will be ignored when loading from the YAML file \"tests/invalid/unknown2/00.yml\"" + "variable or family \"an_unkown_family\" does not exist so cannot load \"an_unkown_family.unknown\", it has been loading from the YAML file \"tests/invalid/unknown2/00.yml\"" ], "warnings": [] } \ No newline at end of file diff --git a/tests/invalid/results/unknown_invalid/errors.json b/tests/invalid/results/unknown_invalid/errors.json index 657ede0..9392218 100644 --- a/tests/invalid/results/unknown_invalid/errors.json +++ b/tests/invalid/results/unknown_invalid/errors.json @@ -1,6 +1,12 @@ { "errors": [], "warnings": [ - "variable or family \"a_family.unknown\" does not exist, it has been loading from the YAML file \"tests/invalid/unknown/00.yml\"" + [ + [ + "variable or family \"unknown\" does not exist so cannot load \"a_family.unknown\", it will be ignored when loading from the YAML file \"tests/invalid/unknown/00.yml\"", + "a_family", + null + ] + ] ] } \ No newline at end of file diff --git a/tests/invalid/results/unknown_invalid_unknown/errors.json b/tests/invalid/results/unknown_invalid_unknown/errors.json index 2ab4105..11c604a 100644 --- a/tests/invalid/results/unknown_invalid_unknown/errors.json +++ b/tests/invalid/results/unknown_invalid_unknown/errors.json @@ -1,6 +1,12 @@ { "errors": [ - "variable or family \"a_family.unknown\" does not exist, it has been loading from the YAML file \"tests/invalid/unknown/00.yml\"" + [ + [ + "variable or family \"unknown\" does not exist so cannot load \"a_family.unknown\", it has been loading from the YAML file \"tests/invalid/unknown/00.yml\"", + "a_family", + null + ] + ] ], "warnings": [] } \ No newline at end of file diff --git a/tests/invalid/results/unknown_unknown/errors.json b/tests/invalid/results/unknown_unknown/errors.json index 9907841..11c604a 100644 --- a/tests/invalid/results/unknown_unknown/errors.json +++ b/tests/invalid/results/unknown_unknown/errors.json @@ -1,6 +1,12 @@ { "errors": [ - "variable or family \"a_family.unknown\" does not exist, it will be ignored when loading from the YAML file \"tests/invalid/unknown/00.yml\"" + [ + [ + "variable or family \"unknown\" does not exist so cannot load \"a_family.unknown\", it has been loading from the YAML file \"tests/invalid/unknown/00.yml\"", + "a_family", + null + ] + ] ], "warnings": [] } \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable11/errors/all.json b/tests/results/04_5disabled_calculation_variable11/errors/all.json new file mode 100644 index 0000000..adda294 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/errors/all.json @@ -0,0 +1,19 @@ +{ + "errors": [], + "warnings": [ + [ + [ + "variable has property disabled, it will be ignored when loading from the YAML file \"tests/results/04_5disabled_calculation_variable11/file/all.yml\"", + "rougail.condition", + null + ] + ], + [ + [ + "family \"condition\" (a condition) has property disabled, so cannot access to \"variable\" (a variable), it will be ignored when loading from the YAML file \"tests/results/04_5disabled_calculation_variable11/file/all.yml\"", + "rougail.variable", + null + ] + ] + ] +} \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable11/errors/mandatories.json b/tests/results/04_5disabled_calculation_variable11/errors/mandatories.json new file mode 100644 index 0000000..ae8bde1 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/errors/mandatories.json @@ -0,0 +1,12 @@ +{ + "errors": [], + "warnings": [ + [ + [ + "family \"condition\" (a condition) has property disabled, so cannot access to \"variable\" (a variable), it will be ignored when loading from the YAML file \"tests/results/04_5disabled_calculation_variable11/file/mandatories.yml\"", + "rougail.variable", + null + ] + ] + ] +} \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable11/file/all.yml b/tests/results/04_5disabled_calculation_variable11/file/all.yml new file mode 100644 index 0000000..6a9b455 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/file/all.yml @@ -0,0 +1,6 @@ +{ + "rougail": { + "condition": true, + "variable": "string1" + } +} \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable11/file/all_exclude.yml b/tests/results/04_5disabled_calculation_variable11/file/all_exclude.yml new file mode 100644 index 0000000..6a9b455 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/file/all_exclude.yml @@ -0,0 +1,6 @@ +{ + "rougail": { + "condition": true, + "variable": "string1" + } +} \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable11/file/mandatories.yml b/tests/results/04_5disabled_calculation_variable11/file/mandatories.yml new file mode 100644 index 0000000..2552665 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/file/mandatories.yml @@ -0,0 +1,5 @@ +{ + "rougail": { + "variable": "string1" + } +} \ No newline at end of file diff --git a/tests/results/04_5disabled_calculation_variable11/makedict/all.json b/tests/results/04_5disabled_calculation_variable11/makedict/all.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/makedict/all.json @@ -0,0 +1 @@ +{} diff --git a/tests/results/04_5disabled_calculation_variable11/makedict/mandatories.json b/tests/results/04_5disabled_calculation_variable11/makedict/mandatories.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/results/04_5disabled_calculation_variable11/makedict/mandatories.json @@ -0,0 +1 @@ +{} diff --git a/tests/results/20_7help_family/errors/all.json b/tests/results/20_7help_family/errors/all.json new file mode 100644 index 0000000..217db0a --- /dev/null +++ b/tests/results/20_7help_family/errors/all.json @@ -0,0 +1,4 @@ +{ + "errors": [], + "warnings": [] +} \ No newline at end of file diff --git a/tests/results/20_7help_family/errors/mandatories.json b/tests/results/20_7help_family/errors/mandatories.json new file mode 100644 index 0000000..217db0a --- /dev/null +++ b/tests/results/20_7help_family/errors/mandatories.json @@ -0,0 +1,4 @@ +{ + "errors": [], + "warnings": [] +} \ No newline at end of file diff --git a/tests/results/20_7help_family/file/all.yml b/tests/results/20_7help_family/file/all.yml new file mode 100644 index 0000000..0c2ef99 --- /dev/null +++ b/tests/results/20_7help_family/file/all.yml @@ -0,0 +1,10 @@ +{ + "rougail": { + "family1": { + "var": "string1" + }, + "family2": { + "var": "string1" + } + } +} \ No newline at end of file diff --git a/tests/results/20_7help_family/file/all_exclude.yml b/tests/results/20_7help_family/file/all_exclude.yml new file mode 100644 index 0000000..0c2ef99 --- /dev/null +++ b/tests/results/20_7help_family/file/all_exclude.yml @@ -0,0 +1,10 @@ +{ + "rougail": { + "family1": { + "var": "string1" + }, + "family2": { + "var": "string1" + } + } +} \ No newline at end of file diff --git a/tests/results/20_7help_family/file/mandatories.yml b/tests/results/20_7help_family/file/mandatories.yml new file mode 100644 index 0000000..0c2ef99 --- /dev/null +++ b/tests/results/20_7help_family/file/mandatories.yml @@ -0,0 +1,10 @@ +{ + "rougail": { + "family1": { + "var": "string1" + }, + "family2": { + "var": "string1" + } + } +} \ No newline at end of file diff --git a/tests/results/20_7help_family/makedict/all.json b/tests/results/20_7help_family/makedict/all.json new file mode 100644 index 0000000..315cf64 --- /dev/null +++ b/tests/results/20_7help_family/makedict/all.json @@ -0,0 +1,4 @@ +{ + "rougail.family1.var": "string1", + "rougail.family2.var": "string1" +} diff --git a/tests/results/20_7help_family/makedict/mandatories.json b/tests/results/20_7help_family/makedict/mandatories.json new file mode 100644 index 0000000..315cf64 --- /dev/null +++ b/tests/results/20_7help_family/makedict/mandatories.json @@ -0,0 +1,4 @@ +{ + "rougail.family1.var": "string1", + "rougail.family2.var": "string1" +} diff --git a/tests/test_load.py b/tests/test_load.py index 142f96d..85387c5 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -139,7 +139,7 @@ def test_errors(): '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"', - 'variable or family "dynVal1" does not exist, it will be ignored when ' + 'variable or family "dynVal1" does not exist so cannot load "dynVal1.var", it will be ignored when ' 'loading from the YAML file ' '"tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml"', ]} @@ -159,7 +159,7 @@ def test_errors_2(): '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"', - 'variable or family "dynVal1" does not exist, it will be ignored when ' + 'variable or family "dynVal1" does not exist so cannot load "dynVal1.var", it will be ignored when ' 'loading from the YAML file ' '"tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml"', ]}