File: test_table.py

package info (click to toggle)
python-textile 1%3A4.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 452 kB
  • sloc: python: 2,620; sh: 7; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 807 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
from textile import Textile

def test_table():
    t = Textile()
    result = t.table('(rowclass). |one|two|three|\n|a|b|c|')
    expect = '\t<table>\n\t\t<tr class="rowclass">\n\t\t\t<td>one</td>\n\t\t\t<td>two</td>\n\t\t\t<td>three</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>a</td>\n\t\t\t<td>b</td>\n\t\t\t<td>c</td>\n\t\t</tr>\n\t</table>\n\n'
    assert result == expect

    t = Textile(lite=True)
    result = t.table('(lite). |one|two|three|\n|a|b|c|\n| * test\n* test|1|2|')
    expect = '\t<table>\n\t\t<tr class="lite">\n\t\t\t<td>one</td>\n\t\t\t<td>two</td>\n\t\t\t<td>three</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>a</td>\n\t\t\t<td>b</td>\n\t\t\t<td>c</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> * test\n* test</td>\n\t\t\t<td>1</td>\n\t\t\t<td>2</td>\n\t\t</tr>\n\t</table>\n\n'
    assert result == expect