from pathlib import Path from rougail import RougailConfig from rougail.output_doc import RougailOutputDoc def test_dictionaries(): test_dir = Path(__file__).resolve().parent rougailconfig = RougailConfig.copy() rougailconfig['step.output'] = 'doc' rougailconfig['force_optional'] = True #FIXME rougailconfig['tiramisu_cache'] = 'p.py' dirs = [str(test_dir / 'force_optional')] rougailconfig['main_dictionaries'] = dirs inventory = RougailOutputDoc(rougailconfig=rougailconfig) doc = inventory.gen_doc() result_file = test_dir / 'force_optional.adoc' if not result_file.is_file(): with open(str(result_file), 'w') as docfh: docfh.write(doc) with open(str(result_file)) as docfh: result = docfh.read() assert doc == result