From d527497b1f232a90bf8f4f84e289f69926be6eb9 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Tue, 23 Oct 2018 18:40:30 +0200 Subject: [PATCH] Moar tests --- tests/test_build_text.py | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/test_build_text.py b/tests/test_build_text.py index 864ce16b7..dd11427ce 100644 --- a/tests/test_build_text.py +++ b/tests/test_build_text.py @@ -12,7 +12,7 @@ import pytest from docutils.utils import column_width -from sphinx.writers.text import MAXWIDTH +from sphinx.writers.text import MAXWIDTH, Table, Cell def with_text_app(*args, **kw): @@ -87,6 +87,41 @@ def test_nonascii_maxwidth(app, status, warning): assert max(line_widths) < MAXWIDTH +def test_table_builder(): + table = Table([6, 6]) + table.add_cell(Cell("foo")) + table.add_cell(Cell("bar")) + table_str = str(table).split("\n") + assert table_str[0] == "+--------+--------+" + assert table_str[1] == "| foo | bar |" + assert table_str[2] == "+--------+--------+" + assert repr(table).count("