fix: update test

This commit is contained in:
egarette@silique.fr 2025-10-10 08:01:45 +02:00
parent 70efb3d8ad
commit 61d96ba6ce
16 changed files with 61 additions and 8 deletions

View file

@ -13,9 +13,6 @@ license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",

View file

@ -0,0 +1,6 @@
{
"errors": [],
"warnings": [
"variable \"variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -0,0 +1,6 @@
{
"errors": [],
"warnings": [
"variable \"variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -0,0 +1,3 @@
ROUGAIL_CONDITION="string1"
ROUGAIL_VARIABLE1="string1"
ROUGAIL_VARIABLE2="string1"

View file

@ -0,0 +1,3 @@
ROUGAIL_CONDITION="string1"
ROUGAIL_VARIABLE1="string1"
ROUGAIL_VARIABLE2="string1"

View file

@ -0,0 +1,2 @@
ROUGAIL_VARIABLE1="string1"
ROUGAIL_VARIABLE2="string1"

View file

@ -0,0 +1,4 @@
{
"condition": "string1",
"variable1": "string1"
}

View file

@ -0,0 +1,4 @@
{
"condition": "no",
"variable1": "string1"
}

View file

@ -0,0 +1,6 @@
{
"errors": [],
"warnings": [
"variable \"rougail.variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -0,0 +1,6 @@
{
"errors": [],
"warnings": [
"variable \"rougail.variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -0,0 +1,3 @@
ROUGAIL.CONDITION="string1"
ROUGAIL.VARIABLE1="string1"
ROUGAIL.VARIABLE2="string1"

View file

@ -0,0 +1,3 @@
ROUGAIL.CONDITION="string1"
ROUGAIL.VARIABLE1="string1"
ROUGAIL.VARIABLE2="string1"

View file

@ -0,0 +1,2 @@
ROUGAIL.VARIABLE1="string1"
ROUGAIL.VARIABLE2="string1"

View file

@ -0,0 +1,4 @@
{
"rougail.condition": "string1",
"rougail.variable1": "string1"
}

View file

@ -0,0 +1,4 @@
{
"rougail.condition": "no",
"rougail.variable1": "string1"
}

View file

@ -50,8 +50,8 @@ def _test_structural_files(test_dir, namespace, ext, *, level, need_exclude=Fals
config = rougail.run()
##################################
root_path = Path('tests') / 'results' / dir_name / test_dir.name
makedict = root_path / 'makedict' / f'{level}.json'
filename = root_path / 'file'
makedict = root_path / 'makedict' / f'{level}.json'
filename = root_path / 'file'
if need_exclude:
filename = filename / f'{level}_exclude.{EXT}'
else:
@ -66,8 +66,8 @@ def _test_structural_files(test_dir, namespace, ext, *, level, need_exclude=Fals
generated_user_data = RougailUserData(config, rougailconfig=rougailconfig).run()
errors = rougail.user_datas(generated_user_data)
#expected output
expected_file = Path('tests') / 'results' / dir_name / test_dir.name / 'makedict' / f'{level}.json'
with open(expected_file) as json_file:
expected_filename = Path('tests') / 'results' / dir_name / test_dir.name / 'makedict' / f'{level}.json'
with expected_filename.open() as json_file:
expected = load(json_file)
# here is the effective test
errors_file = Path('tests') / 'results' / dir_name / test_dir.name / 'errors' / f'{level}.json'
@ -85,7 +85,7 @@ def _test_structural_files(test_dir, namespace, ext, *, level, need_exclude=Fals
#
config.property.read_only()
config_dict = dict(config_to_dict(config.value.get()))
assert expected == config_dict, expected_file
assert expected == config_dict, expected_filename
######################################
#teardown: set the original environement again
os.environ = save.copy()