fix: better error message
This commit is contained in:
parent
d2c79690e4
commit
f8bf91fd7a
69 changed files with 251 additions and 132 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dynVal1": {
|
||||
"var": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
version: '1.1'
|
||||
|
||||
var: [] # A suffix variable
|
||||
|
||||
"dyn{{ identifier }}":
|
||||
description: A dynamic family
|
||||
dynamic:
|
||||
variable: _.var
|
||||
var: # A dynamic variable
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dynVal1": {
|
||||
"var": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"rougail": {
|
||||
"secret1": "string1",
|
||||
"secret2": "string1"
|
||||
"secret1": "onE7vaLues_len1",
|
||||
"secret2": "onE7vaLues_len1"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"rougail": {
|
||||
"secret1": "string1",
|
||||
"secret2": "string1"
|
||||
"secret1": "onE7vaLues_len1",
|
||||
"secret2": "onE7vaLues_len1"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"rougail": {
|
||||
"secret1": "string1"
|
||||
"secret1": "onE7vaLues_len1"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"rougail.secret1": "string1",
|
||||
"rougail.secret2": "string1"
|
||||
"rougail.secret1": "onE7vaLues_len1",
|
||||
"rougail.secret2": "onE7vaLues_len1"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"rougail.secret1": "string1",
|
||||
"rougail.secret1": "onE7vaLues_len1",
|
||||
"rougail.secret2": "value"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -1,9 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,9 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"rougail": {
|
||||
"leader": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
14
tests/results/60_0family_dynamic_upper_char/file/all.yml
Normal file
14
tests/results/60_0family_dynamic_upper_char/file/all.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var": [
|
||||
"Val1",
|
||||
"VAL2"
|
||||
],
|
||||
"dynval1": {
|
||||
"var": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"rougail.var": [
|
||||
"Val1",
|
||||
"VAL2"
|
||||
],
|
||||
"rougail.dynval1.var": "string1",
|
||||
"rougail.dynval2.var": "string1"
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"rougail.var": [
|
||||
"Val1",
|
||||
"VAL2"
|
||||
],
|
||||
"rougail.dynval1.var": "string1",
|
||||
"rougail.dynval2.var": "string1"
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var1": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"dynval1": {
|
||||
"var": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var": "string1"
|
||||
},
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var": "string1"
|
||||
},
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"rougail.var1": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"rougail.var2": "string1"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"rougail.var1": [],
|
||||
"rougail.var2": "string1"
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -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"',
|
||||
]}
|
||||
##################################
|
||||
|
|
|
|||
Loading…
Reference in a new issue