fix: update tests

This commit is contained in:
egarette@silique.fr 2025-12-29 18:52:21 +01:00
parent acf84531a2
commit a14bfee112
42 changed files with 407 additions and 33 deletions

View file

@ -99,26 +99,6 @@ class CommonOutput:
def header(self):
raise NotImplementedError()
#
# def display_errors(
# self,
# tree,
# errors,
# ) -> None:
# errors_dict = {}
# for error in errors:
# self.error_warn_to_dict(error, errors_dict, self.msg_to_error)
# self.parse_error_warning(tree, errors_dict, self.display_error)
# return self.pouet(tree)
# self.error_end()
#
# def display_warnings(
# self,
# warnings_dict,
# warnings,
# ) -> None:
###### self.parse_error_warning(tree, warnings_dict, self.display_warning)
## self.warning_end()
def error_warn_to_dict(self, error, errors_dict, level):
if isinstance(error, dict):
@ -127,12 +107,6 @@ class CommonOutput:
self.subconfig_to_dict(subconfig, errors_dict).setdefault(None, {}).setdefault(description, []).append((msg, level))
else:
errors_dict.setdefault(None, []).append(error)
#
# def msg_to_error(self, msg):
# return msg
#
# def msg_to_warning(self, msg):
# return msg
def subconfig_to_dict(self, subconfig: "Subconfig", errors_dict: dict) -> dict:
#FIXME a tester : mandatories dans une arborescence (voir si ca n'ecrase pas)

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #B8860B">Default value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #B8860B">null</span>
- :open_file_folder: the second family
- :notebook: var: <span style="color: #B8860B">null</span>

View file

@ -0,0 +1,9 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: null
 ┗━━ 📂 the second family
  ┗━━ 📓 var: null

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #B8860B">Default value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #B8860B">null</span>
- :open_file_folder: the second family
- :notebook: var: <span style="color: #B8860B">null</span>

View file

@ -0,0 +1,9 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: null
 ┗━━ 📂 the second family
  ┗━━ 📓 var: null

View file

@ -0,0 +1,12 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: Rougail
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,9 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📂 the first family
 ┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
 ┗━━ 📂 the second family
  ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #B8860B">Default value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #B8860B">null</span>
- :open_file_folder: the second family
- :notebook: var: <span style="color: #B8860B">null</span>

View file

@ -0,0 +1,8 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: null
┗━━ 📂 the second family
 ┗━━ 📓 var: null

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #B8860B">Default value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #B8860B">null</span>
- :open_file_folder: the second family
- :notebook: var: <span style="color: #B8860B">null</span>

View file

@ -0,0 +1,8 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: null
┗━━ 📂 the second family
 ┗━━ 📓 var: null

View file

@ -0,0 +1,11 @@
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #006400">Modified value</span>
Variables:
- :open_file_folder: the first family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test
- :open_file_folder: the second family
- :notebook: var: <span style="color: #006400">string1</span> ◀ loaded from rougail-test

View file

@ -0,0 +1,8 @@
╭──────── Caption ────────╮
│ Variable Modified value │
╰─────────────────────────╯
Variables:
┣━━ 📂 the first family
┃ ┗━━ 📓 var: string1 ◀ loaded from rougail-test
┗━━ 📂 the second family
 ┗━━ 📓 var: string1 ◀ loaded from rougail-test

View file

@ -106,7 +106,7 @@ def test_error_not_valid_user_data():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_errors_for_user_data(), invalid_user_datas_error=True)
errors = rougail.user_data(fake_errors_for_user_data(), invalid_user_data_error=True)
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()
@ -129,7 +129,7 @@ def test_warning_not_valid_user_data():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_errors_for_user_data())
errors = rougail.user_data(fake_errors_for_user_data())
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()
@ -152,7 +152,7 @@ def test_error_not_valid_dyn_user_data():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_dynamic_for_user_data(), invalid_user_datas_error=True, unknown_user_datas_error=True)
errors = rougail.user_data(fake_dynamic_for_user_data(), invalid_user_data_error=True, unknown_user_data_error=True)
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()
@ -175,7 +175,7 @@ def test_error_not_valid_dynfamily_user_data():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_for_user_data('dyn{{ identifier }}.var'), invalid_user_datas_error=True, unknown_user_datas_error=True)
errors = rougail.user_data(fake_for_user_data('dyn{{ identifier }}.var'), invalid_user_data_error=True, unknown_user_data_error=True)
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()
@ -198,7 +198,7 @@ def test_error_not_valid_family_user_data():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_for_user_data(), invalid_user_datas_error=True, unknown_user_datas_error=True)
errors = rougail.user_data(fake_for_user_data(), invalid_user_data_error=True, unknown_user_data_error=True)
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()
@ -221,7 +221,7 @@ def test_warnings_not_valid_family_user_data():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_for_user_data())
errors = rougail.user_data(fake_for_user_data())
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()
@ -244,7 +244,7 @@ def test_error_not_valid_user_data2():
rougail = Rougail(rougailconfig)
config = rougail.run()
config.information.set("description_type", "description")
errors = rougail.user_datas(fake_errors_for_user_data2(), invalid_user_datas_error=True)
errors = rougail.user_data(fake_errors_for_user_data2(), invalid_user_data_error=True)
for output_format, ext in EXT.items():
rougailconfig['display.output_format'] = output_format
no_pb, generated_output = RougailOutput(config, rougailconfig=rougailconfig, user_data_errors=errors["errors"], user_data_warnings=errors["warnings"]).run()