fix: update tests
This commit is contained in:
parent
9dad912ab3
commit
f83b395f77
94 changed files with 608 additions and 2 deletions
3
tests/invalid/invalid/00.yml
Normal file
3
tests/invalid/invalid/00.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
a_family:
|
||||
a_boolean: oups
|
||||
3
tests/invalid/invalid_dyn/00.yml
Normal file
3
tests/invalid/invalid_dyn/00.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
a_str:
|
||||
- ly
|
||||
2
tests/invalid/invalid_family/00.yml
Normal file
2
tests/invalid/invalid_family/00.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
a_family: oups
|
||||
4
tests/invalid/invalid_leadership/00.yml
Normal file
4
tests/invalid/invalid_leadership/00.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
a_leadership:
|
||||
- a_leader: val1
|
||||
a_follower: 1
|
||||
2
tests/invalid/invalid_multi/00.yml
Normal file
2
tests/invalid/invalid_multi/00.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
a_multi: oups
|
||||
5
tests/invalid/invalid_multi2/00.yml
Normal file
5
tests/invalid/invalid_multi2/00.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
a_family:
|
||||
|
||||
a_boolean:
|
||||
- true
|
||||
6
tests/invalid/results/invalid/errors.json
Normal file
6
tests/invalid/results/invalid/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"oups\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), invalid value, it will be ignored when loading from the YAML file \"tests/invalid/invalid/00.yml\""
|
||||
]
|
||||
}
|
||||
4
tests/invalid/results/invalid_dyn/errors.json
Normal file
4
tests/invalid/results/invalid_dyn/errors.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
4
tests/invalid/results/invalid_dyn_invalid/errors.json
Normal file
4
tests/invalid/results/invalid_dyn_invalid/errors.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
4
tests/invalid/results/invalid_dyn_unknown/errors.json
Normal file
4
tests/invalid/results/invalid_dyn_unknown/errors.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/invalid_family/errors.json
Normal file
6
tests/invalid/results/invalid_family/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"cannot set the value \"oups\" to the family \"a_family\" (A family), it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_family_invalid/errors.json
Normal file
6
tests/invalid/results/invalid_family_invalid/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"cannot set the value \"oups\" to the family \"a_family\" (A family), it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"cannot set the value \"oups\" to the family \"a_family\" (A family), it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/invalid_family_unknown/errors.json
Normal file
6
tests/invalid/results/invalid_family_unknown/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"cannot set the value \"oups\" to the family \"a_family\" (A family), it will be ignored when loading from the YAML file \"tests/invalid/invalid_family/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_invalid/errors.json
Normal file
6
tests/invalid/results/invalid_invalid/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"oups\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), invalid value, it will be ignored when loading from the YAML file \"tests/invalid/invalid/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"oups\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), invalid value, it will be ignored when loading from the YAML file \"tests/invalid/invalid/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/invalid_leadership/errors.json
Normal file
6
tests/invalid/results/invalid_leadership/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"1\" is an invalid string for \"a_leadership.a_follower\" (A follower) at index \"0\", which is not a string, it will be ignored when loading from the YAML file \"tests/invalid/invalid_leadership/00.yml\""
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"1\" is an invalid string for \"a_leadership.a_follower\" (A follower) at index \"0\", which is not a string, it will be ignored when loading from the YAML file \"tests/invalid/invalid_leadership/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"1\" is an invalid string for \"a_leadership.a_follower\" (A follower) at index \"0\", which is not a string, it will be ignored when loading from the YAML file \"tests/invalid/invalid_leadership/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"1\" is an invalid string for \"a_leadership.a_follower\" (A follower) at index \"0\", which is not a string, it will be ignored when loading from the YAML file \"tests/invalid/invalid_leadership/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_multi/errors.json
Normal file
6
tests/invalid/results/invalid_multi/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"oups\" is an invalid string for \"a_multi\" (A multi), which must be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_multi2/errors.json
Normal file
6
tests/invalid/results/invalid_multi2/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"[True]\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), which must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_multi2_invalid/errors.json
Normal file
6
tests/invalid/results/invalid_multi2_invalid/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"[True]\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), which must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"[True]\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), which must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/invalid_multi2_unknown/errors.json
Normal file
6
tests/invalid/results/invalid_multi2_unknown/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"[True]\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), which must not be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi2/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_multi_invalid/errors.json
Normal file
6
tests/invalid/results/invalid_multi_invalid/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"oups\" is an invalid string for \"a_multi\" (A multi), which must be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [
|
||||
"the value \"oups\" is an invalid string for \"a_multi\" (A multi), which must be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi/00.yml\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/invalid_multi_unknown/errors.json
Normal file
6
tests/invalid/results/invalid_multi_unknown/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"oups\" is an invalid string for \"a_multi\" (A multi), which must be a list, it will be ignored when loading from the YAML file \"tests/invalid/invalid_multi/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/invalid_unknown/errors.json
Normal file
6
tests/invalid/results/invalid_unknown/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"the value \"oups\" is an invalid boolean for \"a_family.a_boolean\" (A boolean), invalid value, it will be ignored when loading from the YAML file \"tests/invalid/invalid/00.yml\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/unknown/errors.json
Normal file
6
tests/invalid/results/unknown/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"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\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/unknown2/errors.json
Normal file
6
tests/invalid/results/unknown2/errors.json
Normal file
|
|
@ -0,0 +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\""
|
||||
]
|
||||
}
|
||||
6
tests/invalid/results/unknown2_invalid/errors.json
Normal file
6
tests/invalid/results/unknown2_invalid/errors.json
Normal file
|
|
@ -0,0 +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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +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\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/unknown2_unknown/errors.json
Normal file
6
tests/invalid/results/unknown2_unknown/errors.json
Normal file
|
|
@ -0,0 +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\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/unknown_invalid/errors.json
Normal file
6
tests/invalid/results/unknown_invalid/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"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\""
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"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\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/invalid/results/unknown_unknown/errors.json
Normal file
6
tests/invalid/results/unknown_unknown/errors.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"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\""
|
||||
],
|
||||
"warnings": []
|
||||
}
|
||||
23
tests/invalid/structure/00.yml
Normal file
23
tests/invalid/structure/00.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
a_multi: [] # A multi
|
||||
|
||||
a_leadership:
|
||||
description: A leadership
|
||||
type: leadership
|
||||
|
||||
a_leader: # A leader
|
||||
|
||||
a_follower: # A follower
|
||||
|
||||
a_str: # A str
|
||||
- val1
|
||||
|
||||
a_family: # A family
|
||||
|
||||
a_boolean: true # A boolean
|
||||
|
||||
a_fami{{ identifier }}: # A dynamic family
|
||||
...
|
||||
3
tests/invalid/unknown/00.yml
Normal file
3
tests/invalid/unknown/00.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
a_family:
|
||||
unknown: oups
|
||||
3
tests/invalid/unknown2/00.yml
Normal file
3
tests/invalid/unknown2/00.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
an_unkown_family:
|
||||
unknown: oups
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
9
tests/results/01_6integer_multi_mandatory/file/all.yml
Normal file
9
tests/results/01_6integer_multi_mandatory/file/all.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var": [
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var": [
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var": [
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"rougail.var": [
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"rougail.var": [
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
4
tests/results/02_0tags/errors/all.json
Normal file
4
tests/results/02_0tags/errors/all.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
4
tests/results/02_0tags/errors/mandatories.json
Normal file
4
tests/results/02_0tags/errors/mandatories.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
6
tests/results/02_0tags/file/all.yml
Normal file
6
tests/results/02_0tags/file/all.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
6
tests/results/02_0tags/file/all_exclude.yml
Normal file
6
tests/results/02_0tags/file/all_exclude.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
6
tests/results/02_0tags/file/mandatories.yml
Normal file
6
tests/results/02_0tags/file/mandatories.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
4
tests/results/02_0tags/makedict/all.json
Normal file
4
tests/results/02_0tags/makedict/all.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"rougail.var1": "string1",
|
||||
"rougail.var2": "string1"
|
||||
}
|
||||
4
tests/results/02_0tags/makedict/mandatories.json
Normal file
4
tests/results/02_0tags/makedict/mandatories.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"rougail.var1": "string1",
|
||||
"rougail.var2": "string1"
|
||||
}
|
||||
4
tests/results/04_5validators_warnings/errors/all.json
Normal file
4
tests/results/04_5validators_warnings/errors/all.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
5
tests/results/04_5validators_warnings/file/all.yml
Normal file
5
tests/results/04_5validators_warnings/file/all.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail": {
|
||||
"int": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail": {
|
||||
"int": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
3
tests/results/04_5validators_warnings/makedict/all.json
Normal file
3
tests/results/04_5validators_warnings/makedict/all.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.int": 1
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.int": 1000
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
5
tests/results/04_5validators_warnings_all/file/all.yml
Normal file
5
tests/results/04_5validators_warnings_all/file/all.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail": {
|
||||
"int": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail": {
|
||||
"int": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.int": 1
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.int": 1000
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": [
|
||||
"variable \"rougail.var\" (A suffix variable) is hidden, it will be ignored when loading from the YAML file \"tests/results/60_0family_dynamic_source_hidden/file/all.yml\""
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
14
tests/results/60_0family_dynamic_source_hidden/file/all.yml
Normal file
14
tests/results/60_0family_dynamic_source_hidden/file/all.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"rougail": {
|
||||
"var": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"dynval1": {
|
||||
"var": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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,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"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var1": "string1",
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.dynval1.var1": "string1",
|
||||
"rougail.dynval1.var2": "string1",
|
||||
"rougail.dynval2.var1": "string1",
|
||||
"rougail.dynval2.var2": "string1"
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.dynval1.var1": "string1",
|
||||
"rougail.dynval1.var2": "string1",
|
||||
"rougail.dynval2.var1": "string1",
|
||||
"rougail.dynval2.var2": "string1"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"errors": [],
|
||||
"warnings": []
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var1": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var1": "string1"
|
||||
},
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var1": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var1": "string1"
|
||||
},
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"rougail": {
|
||||
"dynval1": {
|
||||
"var1": "string1"
|
||||
},
|
||||
"dynval2": {
|
||||
"var1": "string1"
|
||||
},
|
||||
"var2": "string1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail.dynval1.var1": "string1",
|
||||
"rougail.dynval2.var1": "string1",
|
||||
"rougail.var2": "string1"
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail.dynval1.var1": "string1",
|
||||
"rougail.dynval2.var1": "string1",
|
||||
"rougail.var2": "string1"
|
||||
}
|
||||
1
tests/secrets/no_secret.yml
Normal file
1
tests/secrets/no_secret.yml
Normal file
|
|
@ -0,0 +1 @@
|
|||
---
|
||||
2
tests/secrets/secret.yml
Normal file
2
tests/secrets/secret.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
secret1: my_password
|
||||
68
tests/test_invalid.py
Normal file
68
tests/test_invalid.py
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
from pathlib import Path
|
||||
from json import dump, load
|
||||
from rougail import Rougail, RougailConfig
|
||||
from rougail.user_data_yaml import RougailUserDataYaml
|
||||
|
||||
|
||||
def _test_invalid_no_error(filename):
|
||||
rougailconfig = RougailConfig.copy()
|
||||
rougailconfig["main_namespace"] = None
|
||||
rougailconfig["main_structural_directories"] = ["tests/invalid/structure"]
|
||||
rougailconfig['step.user_data'] = ['yaml']
|
||||
rougailconfig['yaml.filename'] = [f"tests/invalid/{filename}"]
|
||||
rougail = Rougail(rougailconfig)
|
||||
config = rougail.run()
|
||||
for invalid_user_datas_error in [False, True]:
|
||||
if invalid_user_datas_error:
|
||||
ifilename = f"{filename}_invalid"
|
||||
else:
|
||||
ifilename = filename
|
||||
for unknown_user_datas_error in [False, True]:
|
||||
if unknown_user_datas_error:
|
||||
ufilename = f"{ifilename}_unknown"
|
||||
else:
|
||||
ufilename = ifilename
|
||||
generated_user_data = RougailUserDataYaml(config, rougailconfig=rougailconfig).run()
|
||||
errors = rougail.user_datas(generated_user_data, invalid_user_datas_error=invalid_user_datas_error, unknown_user_datas_error=unknown_user_datas_error)
|
||||
print(errors)
|
||||
#expected output
|
||||
expected_filename = Path('tests') / 'invalid' / 'results' / ufilename / "errors.json"
|
||||
if not expected_filename.is_file():
|
||||
expected_filename.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(expected_filename, 'a') as json_file:
|
||||
dump(errors, json_file, indent=4)
|
||||
with open(expected_filename) as json_file:
|
||||
expected_errors = load(json_file)
|
||||
assert expected_errors == errors, expected_filename
|
||||
|
||||
|
||||
def test_invalid():
|
||||
_test_invalid_no_error("invalid")
|
||||
|
||||
|
||||
def test_invalid_dyn():
|
||||
_test_invalid_no_error("invalid_dyn")
|
||||
|
||||
|
||||
def test_invalid_family():
|
||||
_test_invalid_no_error("invalid_family")
|
||||
|
||||
|
||||
def test_invalid_leadership():
|
||||
_test_invalid_no_error("invalid_leadership")
|
||||
|
||||
|
||||
def test_invalid_multi():
|
||||
_test_invalid_no_error("invalid_multi")
|
||||
|
||||
|
||||
def test_invalid_multi2():
|
||||
_test_invalid_no_error("invalid_multi2")
|
||||
|
||||
|
||||
def test_invalid_unknown():
|
||||
_test_invalid_no_error("unknown")
|
||||
|
||||
|
||||
def test_invalid_unknown2():
|
||||
_test_invalid_no_error("unknown2")
|
||||
|
|
@ -20,7 +20,7 @@ excludes = [
|
|||
]
|
||||
|
||||
test_ok = get_structures_list(excludes)
|
||||
# test_ok = [Path('../rougail-tests/structures/60_6family_dynamic_sub_dynamic_empty2')]
|
||||
# test_ok = [Path('../rougail-tests/structures/60_0family_dynamic_source_hidden')]
|
||||
|
||||
|
||||
def idfn(fixture_value):
|
||||
|
|
@ -304,4 +304,3 @@ def test_secret_last_error():
|
|||
assert errors == {'errors': ['the variable "secret1" contains secrets and should not be defined in the YAML file "tests/secrets/secret.yml"'], 'warnings': []}
|
||||
config_dict = dict(config_to_dict(config.value.get()))
|
||||
assert config_dict == {'secret1': None, 'secret2': 'value'}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue