diff --git a/tests/rougailcli_file/symlink_rougailcli.txt b/tests/rougailcli_file/symlink_rougailcli.txt new file mode 100644 index 0000000..fd94c71 --- /dev/null +++ b/tests/rougailcli_file/symlink_rougailcli.txt @@ -0,0 +1 @@ +["unable to load \"Main namespace name\", is a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""] \ No newline at end of file diff --git a/tests/rougailcli_file/symlink_rougailcli.yml b/tests/rougailcli_file/symlink_rougailcli.yml new file mode 100644 index 0000000..2277f74 --- /dev/null +++ b/tests/rougailcli_file/symlink_rougailcli.yml @@ -0,0 +1,4 @@ +--- +main_structural_directories: + - structures +s: doc diff --git a/tests/test_load.py b/tests/test_load.py index 931fa6e..45494df 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -289,3 +289,21 @@ def test_cli_rougailcli_choice(): data = loads(fh.read()) assert ret == (True, data), str(filename.absolute()) os.environ = save + + +def test_cli_rougailcli_symlink(): + save = os.environ.copy() + with chdir(test_dir / 'rougailcli_file'): + os.environ["ROUGAILCLI_CLI.CONFIG_FILE"] = 'symlink_rougailcli.yml' + with warnings.catch_warnings(record=True) as rougail_wn: + warnings.simplefilter("always", UserWarning) + main(["-o", "doc", "--doc.output_format", "asciidoc"], do_not_print=True) + ret = [str(w.message) for w in rougail_wn] + filename = Path('symlink_rougailcli.txt') + if not filename.is_file(): + with filename.open('w') as fh: + fh.write(dumps([str(w.message) for w in rougail_wn])) + with filename.open() as fh: + data = loads(fh.read()) + assert ret == data, str(filename.absolute()) + os.environ = save