Passed
Push — develop ( 04581e...6ee6c6 )
by Christophe
01:36
created

test_table.TableTest.test_blockquote_empty()   A

Complexity

Conditions 1

Size

Total Lines 29
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 29
rs 9.85
c 0
b 0
f 0
cc 1
nop 1
1
from unittest import TestCase
2
3
from panflute import convert_text, Para, Image, Figure, debug
4
5
import pandoc_glfm
6
7
8
class TableTest(TestCase):
9
    @classmethod
10
    def conversion(cls, markdown, fmt="markdown"):
11
        doc = convert_text(markdown, standalone=True)
12
        doc.format = fmt
13
        pandoc_glfm.main(doc)
14
        return doc
15
16
    def test_blockquote_empty(self):
17
        doc = TableTest.conversion(
18
            """
19
| Name | Details |
20
| ---  | ---     |
21
| Item1 | This text is on one line |
22
| Item2 | This item has:<br><br>- Multiple items<br>- That we want listed separately |
23
            """,
24
        )
25
        text = convert_text(
26
            doc,
27
            input_format="panflute",
28
            output_format="markdown",
29
        )
30
        self.assertEqual(
31
            text,
32
            """
33
+-----------------------------------+-----------------------------------+
34
| Name                              | Details                           |
35
+===================================+===================================+
36
| Item1                             | This text is on one line          |
37
+-----------------------------------+-----------------------------------+
38
| Item2                             | This item has:                    |
39
|                                   |                                   |
40
|                                   | -   Multiple items                |
41
|                                   | -   That we want listed           |
42
|                                   |     separately                    |
43
+-----------------------------------+-----------------------------------+
44
              """.strip()
45
        )
46
47