fix: add test with rougailcli that assign a symlinkoption
This commit is contained in:
parent
a5bfc6aecb
commit
f53e8c19bc
3 changed files with 23 additions and 0 deletions
1
tests/rougailcli_file/symlink_rougailcli.txt
Normal file
1
tests/rougailcli_file/symlink_rougailcli.txt
Normal file
|
|
@ -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\""]
|
||||||
4
tests/rougailcli_file/symlink_rougailcli.yml
Normal file
4
tests/rougailcli_file/symlink_rougailcli.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
main_structural_directories:
|
||||||
|
- structures
|
||||||
|
s: doc
|
||||||
|
|
@ -289,3 +289,21 @@ def test_cli_rougailcli_choice():
|
||||||
data = loads(fh.read())
|
data = loads(fh.read())
|
||||||
assert ret == (True, data), str(filename.absolute())
|
assert ret == (True, data), str(filename.absolute())
|
||||||
os.environ = save
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue