fix: dictionary => structure

This commit is contained in:
egarette@silique.fr 2025-09-22 14:27:10 +02:00
parent 7fb265b55c
commit 01231344fc
25 changed files with 278 additions and 37 deletions

View file

@ -0,0 +1,8 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┣━━ 📓 var1: string1 (loaded from rougail-test)
┣━━ 📓 var2: string1 (string1 - loaded from rougail-test)
┗━━ 📓 var3: string1 (loaded from rougail-test)

View file

@ -0,0 +1,14 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 leadership
 ┣━━ 📂 leader
 ┃ ┗━━ 📓 leader: string1 (a - loaded from rougail-test)
 ┣━━ 📂 leader
 ┃ ┣━━ 📓 leader: string2 (b - loaded from rougail-test)
 ┃ ┗━━ 📓 follower: string2 (value - loaded from rougail-test)
 ┗━━ 📂 leader
  ┣━━ 📓 leader: string3 (loaded from rougail-test)
  ┗━━ 📓 follower: string3 (value - loaded from rougail-test)

View file

@ -0,0 +1,9 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📓 a first variable: string1 (loaded from rougail-test)
 ┣━━ 📓 a second variable: string1 (string1 - loaded from rougail-test)
 ┗━━ 📓 a new variable: string1 (loaded from rougail-test)

View file

@ -0,0 +1,15 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┗━━ 📂 a leadership
  ┣━━ 📂 aleader
  ┃ ┗━━ 📓 aleader: string1 (a - loaded from rougail-test)
  ┣━━ 📂 aleader
  ┃ ┣━━ 📓 aleader: string2 (b - loaded from rougail-test)
  ┃ ┗━━ 📓 a follower: string2 (value - loaded from rougail-test)
  ┗━━ 📂 aleader
   ┣━━ 📓 aleader: string3 (loaded from rougail-test)
   ┗━━ 📓 a follower: string3 (value - loaded from rougail-test)

View file

@ -0,0 +1,8 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📓 a first variable:
 ┣━━ 📓 a second variable:
 ┗━━ 📓 a new variable:

View file

@ -0,0 +1,11 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┗━━ 📂 a leadership
  ┣━━ 📂 aleader
  ┃ ┗━━ 📓 aleader: a
  ┗━━ 📂 aleader
   ┣━━ 📓 aleader: b
   ┗━━ 📓 a follower: value

View file

@ -0,0 +1,5 @@
🛑 ERRORS
┗━━ The following variables are mandatory but have no value:
 ┣━━ rougail.var1 (a first variable)
 ┣━━ rougail.var2 (a second variable)
 ┗━━ rougail.var3 (a new variable)

View file

@ -0,0 +1,11 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┗━━ 📂 a leadership
  ┣━━ 📂 aleader
  ┃ ┗━━ 📓 aleader: a
  ┗━━ 📂 aleader
   ┣━━ 📓 aleader: b
   ┗━━ 📓 a follower: value

View file

@ -0,0 +1,9 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📓 a first variable: string1 (loaded from rougail-test)
 ┣━━ 📓 a second variable: string1 (string1 - loaded from rougail-test)
 ┗━━ 📓 a new variable: string1 (loaded from rougail-test)

View file

@ -0,0 +1,15 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┗━━ 📂 a leadership
  ┣━━ 📂 aleader
  ┃ ┗━━ 📓 aleader: string1 (a - loaded from rougail-test)
  ┣━━ 📂 aleader
  ┃ ┣━━ 📓 aleader: string2 (b - loaded from rougail-test)
  ┃ ┗━━ 📓 a follower: string2 (value - loaded from rougail-test)
  ┗━━ 📂 aleader
   ┣━━ 📓 aleader: string3 (loaded from rougail-test)
   ┗━━ 📓 a follower: string3 (value - loaded from rougail-test)

View file

@ -0,0 +1,8 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📓 a first variable:
 ┣━━ 📓 a second variable:
 ┗━━ 📓 a new variable:

View file

@ -0,0 +1,11 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┗━━ 📂 a leadership
  ┣━━ 📂 aleader
  ┃ ┗━━ 📓 aleader: a
  ┗━━ 📂 aleader
   ┣━━ 📓 aleader: b
   ┗━━ 📓 a follower: value

View file

@ -0,0 +1,9 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┣━━ 📓 a first variable: string1 (loaded from rougail-test)
 ┣━━ 📓 a second variable: string1 (string1 - loaded from rougail-test)
 ┗━━ 📓 a new variable: string1 (loaded from rougail-test)

View file

@ -0,0 +1,15 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 Rougail
 ┗━━ 📂 a leadership
  ┣━━ 📂 aleader
  ┃ ┗━━ 📓 aleader: string1 (a - loaded from rougail-test)
  ┣━━ 📂 aleader
  ┃ ┣━━ 📓 aleader: string2 (b - loaded from rougail-test)
  ┃ ┗━━ 📓 a follower: string2 (value - loaded from rougail-test)
  ┗━━ 📂 aleader
   ┣━━ 📓 aleader: string3 (loaded from rougail-test)
   ┗━━ 📓 a follower: string3 (value - loaded from rougail-test)

View file

@ -0,0 +1,7 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┣━━ 📓 var1:
┣━━ 📓 var2:
┗━━ 📓 var3:

View file

@ -0,0 +1,10 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 leadership
 ┣━━ 📂 leader
 ┃ ┗━━ 📓 leader: a
 ┗━━ 📂 leader
  ┣━━ 📓 leader: b
  ┗━━ 📓 follower: value

View file

@ -0,0 +1,8 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┣━━ 📓 var1: string1 (loaded from rougail-test)
┣━━ 📓 var2: string1 (string1 - loaded from rougail-test)
┗━━ 📓 var3: string1 (loaded from rougail-test)

View file

@ -0,0 +1,14 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 leadership
 ┣━━ 📂 leader
 ┃ ┗━━ 📓 leader: string1 (a - loaded from rougail-test)
 ┣━━ 📂 leader
 ┃ ┣━━ 📓 leader: string2 (b - loaded from rougail-test)
 ┃ ┗━━ 📓 follower: string2 (value - loaded from rougail-test)
 ┗━━ 📂 leader
  ┣━━ 📓 leader: string3 (loaded from rougail-test)
  ┗━━ 📓 follower: string3 (value - loaded from rougail-test)

View file

@ -0,0 +1,5 @@
🛑 ERRORS
┗━━ The following variables are mandatory but have no value:
 ┣━━ var1 (a first variable)
 ┣━━ var2 (a second variable)
 ┗━━ var3 (a new variable)

View file

@ -0,0 +1,10 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 leadership
 ┣━━ 📂 leader
 ┃ ┗━━ 📓 leader: a
 ┗━━ 📂 leader
  ┣━━ 📓 leader: b
  ┗━━ 📓 follower: value

View file

@ -0,0 +1,7 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┣━━ 📓 var1:
┣━━ 📓 var2:
┗━━ 📓 var3:

View file

@ -0,0 +1,10 @@
╭─────── Caption ────────╮
│ Variable Default value │
╰────────────────────────╯
Variables:
┗━━ 📂 leadership
 ┣━━ 📂 leader
 ┃ ┗━━ 📓 leader: a
 ┗━━ 📂 leader
  ┣━━ 📓 leader: b
  ┗━━ 📓 follower: value

View file

@ -0,0 +1,8 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┣━━ 📓 var1: string1 (loaded from rougail-test)
┣━━ 📓 var2: string1 (string1 - loaded from rougail-test)
┗━━ 📓 var3: string1 (loaded from rougail-test)

View file

@ -0,0 +1,14 @@
╭───────────── Caption ─────────────╮
│ Variable Modified value │
(Original default value)
╰───────────────────────────────────╯
Variables:
┗━━ 📂 leadership
 ┣━━ 📂 leader
 ┃ ┗━━ 📓 leader: string1 (a - loaded from rougail-test)
 ┣━━ 📂 leader
 ┃ ┣━━ 📓 leader: string2 (b - loaded from rougail-test)
 ┃ ┗━━ 📓 follower: string2 (value - loaded from rougail-test)
 ┗━━ 📂 leader
  ┣━━ 📓 leader: string3 (loaded from rougail-test)
  ┗━━ 📓 follower: string3 (value - loaded from rougail-test)

View file

@ -28,7 +28,7 @@ def test_dir(request):
return request.param
def _test_dictionaries(test_dir, namespace, ext, *, read_write=True, mandatory=False, show_secrets=False, do_calc=True, key_is_description=False):
def _test_structural_files(test_dir, namespace, ext, *, read_write=True, mandatory=False, show_secrets=False, do_calc=True, key_is_description=False):
rougailconfig = get_rougail_config(test_dir, namespace)
if not rougailconfig:
return
@ -74,77 +74,77 @@ def _test_dictionaries(test_dir, namespace, ext, *, read_write=True, mandatory=F
assert generated_output == attented_output, f'filename {output_file}'
def test_dictionaries_console(test_dir):
_test_dictionaries(test_dir, True, EXT)
def test_structural_files_console(test_dir):
_test_structural_files(test_dir, True, EXT)
def test_dictionaries_console_errors(test_dir):
_test_dictionaries(test_dir, True, EXT, do_calc=False, mandatory=True)
def test_structural_files_console_errors(test_dir):
_test_structural_files(test_dir, True, EXT, do_calc=False, mandatory=True)
def test_dictionaries_console_read_only(test_dir):
_test_dictionaries(test_dir, True, EXT, read_write=False)
def test_structural_files_console_read_only(test_dir):
_test_structural_files(test_dir, True, EXT, read_write=False)
def test_dictionaries_console_mandatory(test_dir):
_test_dictionaries(test_dir, True, EXT, mandatory=True)
def test_structural_files_console_mandatory(test_dir):
_test_structural_files(test_dir, True, EXT, mandatory=True)
def test_dictionaries_console_mandatory_read_only(test_dir):
_test_dictionaries(test_dir, True, EXT, read_write=False, mandatory=True)
def test_structural_files_console_mandatory_read_only(test_dir):
_test_structural_files(test_dir, True, EXT, read_write=False, mandatory=True)
def test_dictionaries_console_secrets(test_dir):
_test_dictionaries(test_dir, True, EXT, show_secrets=True)
def test_structural_files_console_secrets(test_dir):
_test_structural_files(test_dir, True, EXT, show_secrets=True)
#################
#key_is_description
def test_dictionaries_console(test_dir):
_test_dictionaries(test_dir, True, EXT, key_is_description=True)
def test_structural_files_console(test_dir):
_test_structural_files(test_dir, True, EXT, key_is_description=True)
def test_dictionaries_console_errors(test_dir):
_test_dictionaries(test_dir, True, EXT, do_calc=False, mandatory=True, key_is_description=True)
def test_structural_files_console_errors(test_dir):
_test_structural_files(test_dir, True, EXT, do_calc=False, mandatory=True, key_is_description=True)
def test_dictionaries_console_read_only(test_dir):
_test_dictionaries(test_dir, True, EXT, read_write=False, key_is_description=True)
def test_structural_files_console_read_only(test_dir):
_test_structural_files(test_dir, True, EXT, read_write=False, key_is_description=True)
def test_dictionaries_console_mandatory(test_dir):
_test_dictionaries(test_dir, True, EXT, mandatory=True, key_is_description=True)
def test_structural_files_console_mandatory(test_dir):
_test_structural_files(test_dir, True, EXT, mandatory=True, key_is_description=True)
def test_dictionaries_console_mandatory_read_only(test_dir):
_test_dictionaries(test_dir, True, EXT, read_write=False, mandatory=True, key_is_description=True)
def test_structural_files_console_mandatory_read_only(test_dir):
_test_structural_files(test_dir, True, EXT, read_write=False, mandatory=True, key_is_description=True)
def test_dictionaries_console_secrets(test_dir):
_test_dictionaries(test_dir, True, EXT, show_secrets=True, key_is_description=True)
def test_structural_files_console_secrets(test_dir):
_test_structural_files(test_dir, True, EXT, show_secrets=True, key_is_description=True)
#################
#namespace
def test_dictionaries_console_namespace(test_dir):
_test_dictionaries(test_dir, False, EXT)
def test_structural_files_console_namespace(test_dir):
_test_structural_files(test_dir, False, EXT)
def test_dictionaries_console_namespace_errors(test_dir):
_test_dictionaries(test_dir, False, EXT, do_calc=False, mandatory=True)
def test_structural_files_console_namespace_errors(test_dir):
_test_structural_files(test_dir, False, EXT, do_calc=False, mandatory=True)
def test_dictionaries_console_namespace_read_only(test_dir):
_test_dictionaries(test_dir, False, EXT, read_write=False)
def test_structural_files_console_namespace_read_only(test_dir):
_test_structural_files(test_dir, False, EXT, read_write=False)
def test_dictionaries_console_namespace_mandatory(test_dir):
_test_dictionaries(test_dir, False, EXT, mandatory=True)
def test_structural_files_console_namespace_mandatory(test_dir):
_test_structural_files(test_dir, False, EXT, mandatory=True)
def test_dictionaries_console_namespace_mandatory_read_only(test_dir):
_test_dictionaries(test_dir, False, EXT, read_write=False, mandatory=True)
def test_structural_files_console_namespace_mandatory_read_only(test_dir):
_test_structural_files(test_dir, False, EXT, read_write=False, mandatory=True)
def test_dictionaries_console_namespace_secrets(test_dir):
_test_dictionaries(test_dir, False, EXT, show_secrets=True)
def test_structural_files_console_namespace_secrets(test_dir):
_test_structural_files(test_dir, False, EXT, show_secrets=True)