feat: multi layers

This commit is contained in:
egarette@silique.fr 2026-05-04 12:30:15 +02:00
parent f6e08b4ebf
commit 6eddf2ba39
16 changed files with 131 additions and 105 deletions

View file

@ -83,6 +83,7 @@ def _main(arguments, do_not_print):
def load_cmd_user_data(rougailconfig, arguments): def load_cmd_user_data(rougailconfig, arguments):
rougailconfig.generate_config() rougailconfig.generate_config()
cmd_config = rougailconfig.config cmd_config = rougailconfig.config
cmd_config.information.set("description_type", "path_and_description")
origin_prop = cmd_config.property.default("read_write", "append") origin_prop = cmd_config.property.default("read_write", "append")
cmd_config.property.setdefault( cmd_config.property.setdefault(
frozenset(origin_prop | {"not_for_commandline"}), "read_write", "append" frozenset(origin_prop | {"not_for_commandline"}), "read_write", "append"
@ -111,7 +112,7 @@ def load_cmd_user_data(rougailconfig, arguments):
if isinstance(warning, dict): if isinstance(warning, dict):
for w, var in warning.items(): for w, var in warning.items():
if var: if var:
warn(UserWarning(f'unable to load "{var.option.impl_get_display_name(var)}", {str(w)}')) warn(UserWarning(_('unable to load {0}, {1}').format(var.option.impl_get_display_name(var, with_quote=True), w)))
else: else:
warn(w) warn(w)
else: else:
@ -177,27 +178,25 @@ def manage_warnings(warnings):
def load_user_data(rougailconfig): def load_user_data(rougailconfig):
layer_datas = {} layer_datas = []
if not rougailconfig["cli.load_config"]: if not rougailconfig["cli.load_config"]:
return None, None, None, {"errors": [], "warnings": []} return None, None, None, {"errors": [], "warnings": []}
try: try:
user_data_names = rougailconfig["step.user_data"] user_data_names = rougailconfig["step.user_data"]
except PropertiesOptionError: except PropertiesOptionError:
user_data_names = [] user_data_names = []
has_layers = rougailconfig["cli.layers"]
if has_layers:
layers = [[ud] for ud in user_data_names]
last_layers = len(layers) - 1
else:
layers = [user_data_names]
last_layers = 0
if rougailconfig["tiramisu_cache"]: if rougailconfig["tiramisu_cache"]:
load_from_tiramisu_cache = rougailconfig["cli.load_from_tiramisu_cache"] load_from_tiramisu_cache = rougailconfig["cli.load_from_tiramisu_cache"]
else: else:
load_from_tiramisu_cache = False load_from_tiramisu_cache = False
rougail = Rougail(rougailconfig, load_from_tiramisu_cache=load_from_tiramisu_cache) rougail = Rougail(rougailconfig, load_from_tiramisu_cache=load_from_tiramisu_cache)
layer_name = "_".join(layers[-1]) has_layers = rougailconfig["cli.layers"]
subconfig = rougail.run(name=layer_name) last_layers = len(user_data_names) - 1
if has_layers and user_data_names:
layer_name = user_data_names[-1]
else:
layer_name = None
subconfig = metaconfig = rougail.run(name=layer_name)
try: try:
read_write = set() read_write = set()
read_only = set() read_only = set()
@ -210,87 +209,112 @@ def load_user_data(rougailconfig):
read_only |= modes read_only |= modes
read_write |= modes read_write |= modes
if read_write: if read_write:
subconfig.property.setdefault( metaconfig.property.setdefault(
frozenset(subconfig.property.default("read_write", "append") | read_write), "read_write", "append" frozenset(metaconfig.property.default("read_write", "append") | read_write), "read_write", "append"
) )
subconfig.property.setdefault( metaconfig.property.setdefault(
frozenset(subconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove" frozenset(metaconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove"
) )
for p in read_write: for p in read_write:
subconfig.permissive.add(p) metaconfig.permissive.add(p)
if read_only: if read_only:
subconfig.property.setdefault( metaconfig.property.setdefault(
frozenset(subconfig.property.default("read_only", "append") | read_only), "read_only", "append" frozenset(metaconfig.property.default("read_only", "append") | read_only), "read_only", "append"
) )
for p in read_only: for p in read_only:
subconfig.permissive.add(p) metaconfig.permissive.add(p)
if read_write or read_only: if read_write or read_only:
subconfig.property.read_write() metaconfig.property.read_write()
except: except:
pass pass
subconfig.information.set("description_type", rougailconfig["cli.description_type"]) metaconfig.information.set("description_type", rougailconfig["cli.description_type"])
metaconfig = subconfig rougail_user_datas = {}
if last_layers: interactive_user_datas = {}
for layer in reversed(layers[:-1]): for ud_idx, user_data_name in enumerate(reversed(user_data_names)):
layer_name = "_".join(layer) path = (
metaconfig = MetaConfig([metaconfig], name=layer_name) Path(__file__).parent.parent
metaconfig.owner.set(metaconfig.path()) / ("user_data_" + user_data_name)
subconfig = metaconfig / "__init__.py"
)
if not path.is_file():
raise Exception(
_('cannot find "user_data" module "{0}"').format(user_data_name)
)
module = load_modules("rougail.user_data_" + user_data_name, str(path))
rougail_user_data = module.RougailUserData
has_several_layers = hasattr(rougail_user_data, 'has_several_layers') and rougail_user_data.has_several_layers
if has_layers and has_several_layers:
layers_len = rougail_user_data(None, rougailconfig=rougailconfig).count_layers()
else:
layers_len = 1
for idx in range(layers_len):
if ud_idx and has_layers:
metaconfig = MetaConfig([metaconfig], name=user_data_name)
if not idx:
has_interactive_user_data = hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data
if has_interactive_user_data:
interactive_user_datas[user_data_name] = rougail_user_data
else:
if interactive_user_datas:
raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_datas), user_data_name))
rougail_user_datas[user_data_name] = rougail_user_data
root_metaconfig = metaconfig
err_warn = {"errors": [], "warnings": []} err_warn = {"errors": [], "warnings": []}
invalid_user_data_error = rougailconfig["cli.invalid_user_data_error"] invalid_user_data_error = rougailconfig["cli.invalid_user_data_error"]
unknown_user_data_error = rougailconfig["cli.unknown_user_data_error"] unknown_user_data_error = rougailconfig["cli.unknown_user_data_error"]
interactive_user_data = {} user_datas = []
for idx, layer in enumerate(layers): for idx, user_data_name in enumerate(reversed(rougail_user_datas)):
if idx: rougail_user_data = rougail_user_datas[user_data_name]
subconfig = subconfig.config("_".join(layer)) if has_layers and idx:
subconfig.owner.set(subconfig.path()) metaconfig = metaconfig.config(user_data_name)
layer_name = subconfig.path() metaconfig.owner.set(metaconfig.path())
# data user for ud_idx, user_data in enumerate(rougail_user_data(
user_data = []
if has_layers:
layer_datas[layer_name] = {}
for user_data_name in layer:
path = (
Path(__file__).parent.parent
/ ("user_data_" + user_data_name)
/ "__init__.py"
)
if not path.is_file():
raise Exception(
_('cannot find "user_data" module "{0}"').format(user_data_name)
)
module = load_modules("rougail.user_data_" + user_data_name, str(path))
rougail_user_data = module.RougailUserData
if hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data:
interactive_user_data.setdefault(layer_name, {})[user_data_name] = rougail_user_data
continue
elif interactive_user_data:
raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_data), user_data_name))
for ud in rougail_user_data(
subconfig, subconfig,
rougailconfig=rougailconfig, rougailconfig=rougailconfig,
).run(): ).run()):
if has_layers: if has_layers and ud_idx:
layer_datas[layer_name].setdefault(user_data_name, []).append(ud["source"]) metaconfig = metaconfig.config(user_data_name)
user_data.append(ud) metaconfig.owner.set(metaconfig.path())
if user_data: if has_layers:
new_err_warn = UserData(subconfig).user_data(user_data, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error) layer_datas.append(user_data["source"])
for level, datas in new_err_warn.items(): new_err_warn = UserData(metaconfig).user_data([user_data], invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
if datas: for level, datas in new_err_warn.items():
err_warn[level].extend(datas) if datas:
for layer_name, interactive_user_data in interactive_user_data.items(): err_warn[level].extend(datas)
for layer, rougail_user_data in interactive_user_data.items(): else:
if has_layers and len(layers) > 1: user_datas.append(user_data)
subconfig = subconfig.config("_".join(layer)) if user_datas and not has_layers:
subconfig.owner.set(subconfig.path()) new_err_warn = UserData(metaconfig).user_data(user_datas, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
for user_data in rougail_user_data( for level, datas in new_err_warn.items():
subconfig, if datas:
rougailconfig=rougailconfig, err_warn[level].extend(datas)
).run(): user_datas = []
if has_layers: for idx, user_data_name in enumerate(reversed(interactive_user_datas)):
layer_datas[layer_name].setdefault(user_data_name, []).append(user_data["source"]) rougail_user_data = interactive_user_datas[user_data_name]
if has_layers and idx:
return layer_datas, metaconfig, subconfig, err_warn metaconfig = metaconfig.config(user_data_name)
metaconfig.owner.set(metaconfig.path())
for ud_idx, user_data in enumerate(rougail_user_data(
subconfig,
rougailconfig=rougailconfig,
).run()):
if has_layers and ud_idx:
metaconfig = metaconfig.config(user_data_name)
metaconfig.owner.set(metaconfig.path())
if has_layers:
layer_datas.append(user_data["source"])
new_err_warn = UserData(metaconfig).user_data([user_data], invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
for level, datas in new_err_warn.items():
if datas:
err_warn[level].extend(datas)
else:
user_datas.append(user_data)
if user_datas and not has_layers:
new_err_warn = UserData(metaconfig).user_data(user_datas, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
for level, datas in new_err_warn.items():
if datas:
err_warn[level].extend(datas)
return layer_datas, root_metaconfig, subconfig, err_warn
def get_output(rougailconfig, metaconfig, config, err_warn, layer_datas): def get_output(rougailconfig, metaconfig, config, err_warn, layer_datas):
@ -328,6 +352,5 @@ def main(arguments=None, do_not_print=False):
except Exception as err: except Exception as err:
if print_traceback: if print_traceback:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
exit(_("ERROR: {0}").format(err)) exit(_("ERROR: {0}").format(err))

View file

@ -2,11 +2,14 @@
│ Variable Modified value │ │ Variable Modified value │
│ (⏳ Original default value) │ │ (⏳ Original default value) │
╰──────────────────────────────────────╯ ╰──────────────────────────────────────╯
╭─────────── Layers ────────────╮ ╭───────────── Layers ─────────────╮
│ environment variable │ │ • environment variable │
│ the YAML file "yaml/file.yml" │ │ • the YAML file "yaml/file.yml" │
│ Bitwarden │ │ • the YAML file "yaml/file2.yml" │
╰───────────────────────────────╯ │ • Bitwarden │
╰──────────────────────────────────╯
Variables: Variables:
┗━━ 📓 a description: a yaml value ◀ loaded from the YAML file "yaml/file.yml" ┗━━ 📓 a description: a second yaml value ◀ loaded from the YAML file
 (⏳ my env value ◀ loaded from environment variable ⏳ my_value)  "yaml/file2.yml" (⏳ a yaml value ◀ loaded from the YAML file
 "yaml/file.yml" ⏳ my env value ◀ loaded from environment variable ⏳
 my_value)

2
tests/cli/yaml/file2.yml Normal file
View file

@ -0,0 +1,2 @@
---
my_variable: a second yaml value

View file

@ -1 +1 @@
"\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u001b[1m \u001b[0m\u001b[1mVariable \u001b[0m\u001b[1m \u001b[0m\u2503\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m\u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 \u001b[1mmy_variable\u001b[0m \u2502 A description. \u2502\n\u2502 \u001b[1;7m string \u001b[0m \u001b[1;7m mandatory \u001b[0m \u2502 \u001b[1mDefault\u001b[0m: my_value \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n" "\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u001b[1m \u001b[0m\u001b[1mVariable \u001b[0m\u001b[1m \u001b[0m\u2503\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m\u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 \u001b[1mmy_variable\u001b[0m \u2502 A description. \u2502\n\u2502 \u001b[1;7m string \u001b[0m \u001b[1;7m mandatory \u001b[0m \u2502 \u001b[1mDefault\u001b[0m: my_value \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n"

View file

@ -1 +1 @@
"[cols=\"1a,1a\"]\n|====\n| Variable | Description \n| **my_variable** +\n`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | A description. +\n**Default**: my_value \n|====\n\n" "[cols=\"1a,1a\"]\n|====\n| Variable | Description \n| **my_variable** +\n`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | A description. +\n**Default**: my_value \n|===="

View file

@ -1 +1 @@
["unable to load \"Main namespace name\", it's a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""] ["unable to load \"s\" (Main namespace name), it's a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""]

View file

@ -1 +1 @@
["unable to load \"test mandatories variables before display in JSON\", family \"Export configuration to JSON format\" has property disabled, so cannot access to \"test mandatories variables before display in JSON\", it will be ignored when loading from the YAML file \"warnings.yml\""] ["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings.yml\""]

View file

@ -3,5 +3,5 @@ main_structural_directories:
- structures - structures
doc: doc:
output_format: console output_format: console
json: bitwarden:
mandatory: true mock_enable: true

View file

@ -3,7 +3,7 @@ main_structural_directories:
- structures - structures
doc: doc:
output_format: console output_format: console
json: bitwarden:
mandatory: true mock_enable: true
cli: cli:
warnings: false warnings: false

View file

@ -1 +1 @@
["unable to load \"test mandatories variables before display in JSON\", family \"Export configuration to JSON format\" has property disabled, so cannot access to \"test mandatories variables before display in JSON\", it will be ignored when loading from the YAML file \"warnings3.yml\""] ["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings3.yml\""]

View file

@ -4,5 +4,5 @@ main_structural_directories:
- structures_warnings - structures_warnings
doc: doc:
output_format: console output_format: console
json: bitwarden:
mandatory: true mock_enable: true

View file

@ -4,7 +4,5 @@ main_structural_directories:
- structures_warnings - structures_warnings
doc: doc:
output_format: console output_format: console
json:
mandatory: true
cli: cli:
warnings: false warnings: false

View file

@ -1 +1 @@
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}" "{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"

View file

@ -1 +1 @@
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}" "{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"

View file

@ -1 +1 @@
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}" "{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"

View file

@ -25,7 +25,7 @@ def test_cli():
def test_cli_boolean(): def test_cli_boolean():
with chdir(test_dir / 'cli'): with chdir(test_dir / 'cli'):
ret = main(['--main_structural_directories', 'structures', '--display.mandatory'], do_not_print=True) ret = main(['--main_structural_directories', 'structures', '--cli.warnings'], do_not_print=True)
filename = Path('result.txt') filename = Path('result.txt')
if not filename.is_file(): if not filename.is_file():
with filename.open('w') as fh: with filename.open('w') as fh:
@ -37,7 +37,7 @@ def test_cli_boolean():
def test_cli_boolean_no(): def test_cli_boolean_no():
with chdir(test_dir / 'cli'): with chdir(test_dir / 'cli'):
ret = main(['--main_structural_directories', 'structures', '--display.no-mandatory'], do_not_print=True) ret = main(['--main_structural_directories', 'structures', '--cli.no-warnings'], do_not_print=True)
filename = Path('result.txt') filename = Path('result.txt')
if not filename.is_file(): if not filename.is_file():
with filename.open('w') as fh: with filename.open('w') as fh:
@ -116,7 +116,7 @@ def test_cli_user_datas_user_datas_layers():
save = os.environ.copy() save = os.environ.copy()
os.environ["ROUGAIL_MY_VARIABLE"] = "my env value" os.environ["ROUGAIL_MY_VARIABLE"] = "my env value"
with chdir(test_dir / 'cli'): with chdir(test_dir / 'cli'):
ret = main(['--main_structural_directories', 'structures', '--cli.layers', '--step.user_data', 'environment', 'yaml', 'bitwarden', '--yaml.filename', 'yaml/file.yml', '--bitwarden.mock_enable'], do_not_print=True) ret = main(['--main_structural_directories', 'structures', '--cli.layers', '--step.user_data', 'environment', 'yaml', 'bitwarden', '--yaml.filename', 'yaml/file.yml', 'yaml/file2.yml', '--bitwarden.mock_enable'], do_not_print=True)
filename = Path('result_user_datas_layers.txt') filename = Path('result_user_datas_layers.txt')
if not filename.is_file(): if not filename.is_file():
with filename.open('w') as fh: with filename.open('w') as fh: