def test_inline_clean(): with tempfile.NamedTemporaryFile("w") as ftmp: write_lines_to_file(ftmp, 10) res = result_generator(textwrap.dedent(f"""\ head <!-- <inline src="{ftmp.name}" start=4 end="6"> --> <!-- </inline> --> tail """).splitlines(keepends=True), clean=True) assert "".join(res) == textwrap.dedent(f"""\ head <!-- <inline src="{ftmp.name}" start=4 end="6"> --> <!-- </inline> --> tail """)
def test_inline_basic(): with tempfile.NamedTemporaryFile("w") as ftmp: write_lines_to_file(ftmp, 2) res = result_generator( textwrap.dedent(f"""\ head <!-- <inline src="{ftmp.name}"> --> <!-- </inline> --> tail """).splitlines(keepends=True)) assert "".join(res) == textwrap.dedent(f"""\ head <!-- <inline src="{ftmp.name}"> --> line 1 of included file line 2 of included file <!-- </inline> --> tail """)