diff --git a/pyproject.toml b/pyproject.toml index f6bcc44..228e4c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,13 +8,10 @@ version = "0.2.0a8" authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] readme = "README.md" description = "Rougail output json" -requires-python = ">=3.8" +requires-python = ">=3.10" 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", @@ -24,10 +21,10 @@ classifiers = [ "Operating System :: OS Independent", "Natural Language :: English", "Natural Language :: French", - ] + dependencies = [ - "rougail >= 1.1,<2", + "rougail-base >= 1.1,<2", ] [project.urls] diff --git a/tests/results/test/00_2default_calculated_variable_description_multi_line.json b/tests/results/test/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..6242dc5 --- /dev/null +++ b/tests/results/test/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,5 @@ +{ + "var1": "string1", + "var2": "string1", + "var3": "string1" +} \ No newline at end of file diff --git a/tests/results/test/44_4disabled_calcultion_follower_index.json b/tests/results/test/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..5b733ad --- /dev/null +++ b/tests/results/test/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,15 @@ +{ + "leadership": [ + { + "leader": "string1" + }, + { + "leader": "string2", + "follower": "string2" + }, + { + "leader": "string3", + "follower": "string3" + } + ] +} \ No newline at end of file diff --git a/tests/results/test_mandatory/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_mandatory/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..6242dc5 --- /dev/null +++ b/tests/results/test_mandatory/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,5 @@ +{ + "var1": "string1", + "var2": "string1", + "var3": "string1" +} \ No newline at end of file diff --git a/tests/results/test_mandatory/44_4disabled_calcultion_follower_index.json b/tests/results/test_mandatory/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..5b733ad --- /dev/null +++ b/tests/results/test_mandatory/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,15 @@ +{ + "leadership": [ + { + "leader": "string1" + }, + { + "leader": "string2", + "follower": "string2" + }, + { + "leader": "string3", + "follower": "string3" + } + ] +} \ No newline at end of file diff --git a/tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..f6b6d41 --- /dev/null +++ b/tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,7 @@ +{ + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } +} \ No newline at end of file diff --git a/tests/results/test_namespace/44_4disabled_calcultion_follower_index.json b/tests/results/test_namespace/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..7ee30eb --- /dev/null +++ b/tests/results/test_namespace/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,17 @@ +{ + "rougail": { + "leadership": [ + { + "leader": "string1" + }, + { + "leader": "string2", + "follower": "string2" + }, + { + "leader": "string3", + "follower": "string3" + } + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..f6b6d41 --- /dev/null +++ b/tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,7 @@ +{ + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_mandatory/44_4disabled_calcultion_follower_index.json b/tests/results/test_namespace_mandatory/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..7ee30eb --- /dev/null +++ b/tests/results/test_namespace_mandatory/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,17 @@ +{ + "rougail": { + "leadership": [ + { + "leader": "string1" + }, + { + "leader": "string2", + "follower": "string2" + }, + { + "leader": "string3", + "follower": "string3" + } + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..d126aae --- /dev/null +++ b/tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,7 @@ +{ + "rougail": { + "var1": null, + "var2": null, + "var3": null + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write/44_4disabled_calcultion_follower_index.json b/tests/results/test_namespace_read_write/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..481b2ce --- /dev/null +++ b/tests/results/test_namespace_read_write/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,13 @@ +{ + "rougail": { + "leadership": [ + { + "leader": "a" + }, + { + "leader": "b", + "follower": "value" + } + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..f6b6d41 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,7 @@ +{ + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write_mandatory/44_4disabled_calcultion_follower_index.json b/tests/results/test_namespace_read_write_mandatory/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..7ee30eb --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,17 @@ +{ + "rougail": { + "leadership": [ + { + "leader": "string1" + }, + { + "leader": "string2", + "follower": "string2" + }, + { + "leader": "string3", + "follower": "string3" + } + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..d124cad --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,8 @@ +{ + "_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)" + ] +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write_mandatory_errors/44_4disabled_calcultion_follower_index.json b/tests/results/test_namespace_read_write_mandatory_errors/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..481b2ce --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,13 @@ +{ + "rougail": { + "leadership": [ + { + "leader": "a" + }, + { + "leader": "b", + "follower": "value" + } + ] + } +} \ No newline at end of file diff --git a/tests/results/test_read_write/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_read_write/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..52a98ea --- /dev/null +++ b/tests/results/test_read_write/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,5 @@ +{ + "var1": null, + "var2": null, + "var3": null +} \ No newline at end of file diff --git a/tests/results/test_read_write/44_4disabled_calcultion_follower_index.json b/tests/results/test_read_write/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..9cc05d0 --- /dev/null +++ b/tests/results/test_read_write/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,11 @@ +{ + "leadership": [ + { + "leader": "a" + }, + { + "leader": "b", + "follower": "value" + } + ] +} \ No newline at end of file diff --git a/tests/results/test_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..6242dc5 --- /dev/null +++ b/tests/results/test_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,5 @@ +{ + "var1": "string1", + "var2": "string1", + "var3": "string1" +} \ No newline at end of file diff --git a/tests/results/test_read_write_mandatory/44_4disabled_calcultion_follower_index.json b/tests/results/test_read_write_mandatory/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..5b733ad --- /dev/null +++ b/tests/results/test_read_write_mandatory/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,15 @@ +{ + "leadership": [ + { + "leader": "string1" + }, + { + "leader": "string2", + "follower": "string2" + }, + { + "leader": "string3", + "follower": "string3" + } + ] +} \ No newline at end of file diff --git a/tests/results/test_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..5b189cd --- /dev/null +++ b/tests/results/test_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,8 @@ +{ + "_errors": [ + "The following variables are mandatory but have no value:", + " - var1 (a first variable)", + " - var2 (a second variable)", + " - var3 (a new variable)" + ] +} \ No newline at end of file diff --git a/tests/results/test_read_write_mandatory_errors/44_4disabled_calcultion_follower_index.json b/tests/results/test_read_write_mandatory_errors/44_4disabled_calcultion_follower_index.json new file mode 100644 index 0000000..9cc05d0 --- /dev/null +++ b/tests/results/test_read_write_mandatory_errors/44_4disabled_calcultion_follower_index.json @@ -0,0 +1,11 @@ +{ + "leadership": [ + { + "leader": "a" + }, + { + "leader": "b", + "follower": "value" + } + ] +} \ No newline at end of file diff --git a/tests/test_load.py b/tests/test_load.py index 15db088..4ccc8a5 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -28,7 +28,7 @@ def test_dir(request): return request.param -def _test_dictionaries(test_dir, namespace, ext, *, read_write=True, mandatory=False, do_calc=True): +def _test_structural_files(test_dir, namespace, ext, *, read_write=True, mandatory=False, do_calc=True): rougailconfig = get_rougail_config(test_dir, namespace) if not rougailconfig: return @@ -68,42 +68,42 @@ def _test_dictionaries(test_dir, namespace, ext, *, read_write=True, mandatory=F assert generated_output == attented_output, f'filename {output_file}' -def test_dictionaries_json(test_dir): - _test_dictionaries(test_dir, True, EXT) +def test_structural_files_json(test_dir): + _test_structural_files(test_dir, True, EXT) -def test_dictionaries_json_errors(test_dir): - _test_dictionaries(test_dir, True, EXT, do_calc=False, mandatory=True) +def test_structural_files_json_errors(test_dir): + _test_structural_files(test_dir, True, EXT, do_calc=False, mandatory=True) -def test_dictionaries_json_read_only(test_dir): - _test_dictionaries(test_dir, True, EXT, read_write=False) +def test_structural_files_json_read_only(test_dir): + _test_structural_files(test_dir, True, EXT, read_write=False) -def test_dictionaries_json_mandatory(test_dir): - _test_dictionaries(test_dir, True, EXT, mandatory=True) +def test_structural_files_json_mandatory(test_dir): + _test_structural_files(test_dir, True, EXT, mandatory=True) -def test_dictionaries_json_mandatory_read_only(test_dir): - _test_dictionaries(test_dir, True, EXT, read_write=False, mandatory=True) +def test_structural_files_json_mandatory_read_only(test_dir): + _test_structural_files(test_dir, True, EXT, read_write=False, mandatory=True) ################# -def test_dictionaries_json_namespace(test_dir): - _test_dictionaries(test_dir, False, EXT) +def test_structural_files_json_namespace(test_dir): + _test_structural_files(test_dir, False, EXT) -def test_dictionaries_json_namespace_errors(test_dir): - _test_dictionaries(test_dir, False, EXT, do_calc=False, mandatory=True) +def test_structural_files_json_namespace_errors(test_dir): + _test_structural_files(test_dir, False, EXT, do_calc=False, mandatory=True) -def test_dictionaries_json_namespace_read_only(test_dir): - _test_dictionaries(test_dir, False, EXT, read_write=False) +def test_structural_files_json_namespace_read_only(test_dir): + _test_structural_files(test_dir, False, EXT, read_write=False) -def test_dictionaries_json_namespace_mandatory(test_dir): - _test_dictionaries(test_dir, False, EXT, mandatory=True) +def test_structural_files_json_namespace_mandatory(test_dir): + _test_structural_files(test_dir, False, EXT, mandatory=True) -def test_dictionaries_json_namespace_mandatory_read_only(test_dir): - _test_dictionaries(test_dir, False, EXT, read_write=False, mandatory=True) +def test_structural_files_json_namespace_mandatory_read_only(test_dir): + _test_structural_files(test_dir, False, EXT, read_write=False, mandatory=True)