Added more flexible way of specifying random tables in the GM sheet.

This commit is contained in:
Mark Wolfman
2021-08-11 21:56:03 -05:00
parent 37a159f39f
commit e7ccb6f9f3
9 changed files with 493 additions and 366 deletions
+3
View File
@@ -103,6 +103,9 @@ class MarkdownTestCase(unittest.TestCase):
self.assertNotIn("endfoot", tex)
self.assertNotIn("endhead", tex)
self.assertNotIn("endfirsthead", tex)
# Check that fancy decorations uses the DndTable environment
tex = latex.rst_to_latex(table_rst, use_dnd_decorations=True)
self.assertIn(r"\begin{DndTable}{l l l }", tex)
def test_rst_all_spells(self):
for spell in spells.all_spells():
+26
View File
@@ -0,0 +1,26 @@
import unittest
from dungeonsheets import random_tables
class ChildTable(random_tables.RandomTable):
"""I'm a table too, but where is everyone else?"""
name = "Child Table"
class ParentTable(random_tables.RandomTable):
"""Hello, world. I'm a table."""
name = "Parent Table"
subtables = [ChildTable]
class RandomTableTests(unittest.TestCase):
def test_docstring(self):
self.assertIn("Hello, world", ParentTable.__doc__)
parent_table = ParentTable()
self.assertIn("Hello, world", parent_table.__doc__)
def test_subtables(self):
# Check that docstrings are combined
# parent_table = ParentTable()
self.assertIn("**Child Table**", ParentTable.__doc__)