from asciidoc import asciidoc
import io
import pytest
@pytest.mark.parametrize(
"input,expected",
(
(
'{attach}file.txt',
'
\r\n'
),
(
'\\{attach}file.txt',
'\r\n'
),
(
'link:{attach}file.txt[file]',
'\r\n'
),
(
'link:\\{attach}file.txt[file]',
'\r\n'
),
(
'image:\\{attach}file.jpg[]',
'\r\n' +
'
\r\n' +
'
\r\n'
),
(
'image:\\{attach}file.jpg[foo]',
'\r\n' +
'
\r\n
\r\n'
),
)
)
def test_ignore_attribute(input, expected):
infile = io.StringIO(input)
outfile = io.StringIO()
options = [
('--out-file', outfile),
('--no-header-footer', '')
]
asciidoc.execute('asciidoc', options, [infile])
assert outfile.getvalue() == expected