verify_conversion()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
1
# This Python file uses the following encoding: utf-8
2
3
from panflute import *
4
5
import pandoc_latex_unlisted
6
7
def conversion(markdown, format='markdown'):
8
    doc = convert_text(markdown, standalone = True)
9
    doc.format = format
10
    pandoc_latex_unlisted.main(doc)
11
    return doc
12
13
def verify_conversion(markdown, expected, format='markdown'):
14
    doc = conversion(markdown, format)
15
    text = convert_text(doc, input_format='panflute', output_format='markdown', extra_args=['--wrap=none'], standalone=True)
16
    debug('**computed**')
17
    debug(text.strip())
18
    debug('**expected**')
19
    debug(expected.strip())
20
    assert text.strip() == expected.strip()
21
22