summaryrefslogtreecommitdiffstats
path: root/rtemsspec/tests/test_content_sphinx.py
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-05-05 14:41:18 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-05-08 14:34:56 +0200
commitbad73b6d29b03ea1a2ff344b25c602dc46ddaeeb (patch)
tree5d28e5bf6610757d3e185396d683c9e11a1670e4 /rtemsspec/tests/test_content_sphinx.py
parentcontent: Fix to_camel_case() (diff)
downloadrtems-central-bad73b6d29b03ea1a2ff344b25c602dc46ddaeeb.tar.bz2
sphinxcontent: Add add_grid_table()
Diffstat (limited to 'rtemsspec/tests/test_content_sphinx.py')
-rw-r--r--rtemsspec/tests/test_content_sphinx.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/rtemsspec/tests/test_content_sphinx.py b/rtemsspec/tests/test_content_sphinx.py
index 35e7282a..2176b332 100644
--- a/rtemsspec/tests/test_content_sphinx.py
+++ b/rtemsspec/tests/test_content_sphinx.py
@@ -286,6 +286,42 @@ def test_simple_table():
"""
+def test_grid_table():
+ content = SphinxContent()
+ content.add_grid_table([], [])
+ assert str(content) == ""
+ content.add_grid_table([["a", "b"], ["cc", "ddd"]], [50, 50])
+ content.add_grid_table(
+ [["1", "2", "3"], ["aa", "bbb", "cccc"], ["ddd", "", "e"],
+ ["ff", "g", "h"], ["", "i", "j"]], [30, 30, 40])
+ assert str(content) == """.. table::
+ :class: longtable
+ :widths: 50,50
+
+ +----+-----+
+ | a | b |
+ +====+=====+
+ | cc | ddd |
+ +----+-----+
+
+.. table::
+ :class: longtable
+ :widths: 30,30,40
+
+ +-----+-----+------+
+ | 1 | 2 | 3 |
+ +=====+=====+======+
+ | aa | bbb | cccc |
+ +-----+ +------+
+ | ddd | | e |
+ +-----+-----+------+
+ | ff | g | h |
+ + +-----+------+
+ | | i | j |
+ +-----+-----+------+
+"""
+
+
def test_substitute(tmpdir):
config = create_item_cache_config_and_copy_spec(tmpdir,
"spec-sphinx",