Completed
Push — master ( 38c5b4...e7976e )
by Christophe
26s
created

test_span()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 2
rs 10
1
# This Python file uses the following encoding: utf-8
2
from unittest import TestCase
3
from pandocfilters import Para, Str, Space, Span, Div, Strong, RawInline, RawBlock, Emph, Header
4
5
import pandoc_latex_tip
6
7
def test_span():
8
    do_test(Span(['', ['class1', 'class2'], []], []))
9
10
def test_div():
11
    do_test(Div(['', ['class1', 'class2'], []], []))
12
13
def do_test(src):
14
    meta = {
15
        'pandoc-latex-tip': {
16
            't': 'MetaList',
17
            'c': [
18
                {
19
                    't': 'MetaMap',
20
                    'c': {
21
                        'classes': {
22
                            't': 'MetaList',
23
                            'c': [
24
                                {
25
                                    't': 'MetaInlines',
26
                                    'c': [
27
                                        {
28
                                            't': 'Str',
29
                                            'c': 'class1'
30
                                        }
31
                                    ]
32
                                },
33
                                {
34
                                    't': 'MetaInlines',
35
                                    'c': [
36
                                        {
37
                                            't': 'Str',
38
                                            'c': 'class2'
39
                                        }
40
                                    ]
41
                                }
42
                            ]
43
                        },
44
                    }
45
                }
46
            ]
47
        }
48
    }
49
50
51
    dest = pandoc_latex_tip.tip(src['t'], src['c'], 'latex', meta)
52
    assert dest[0]['c'][0] == 'tex'
53
54