mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-19 04:33:26 +02:00
Added more flexible way of specifying random tables in the GM sheet.
This commit is contained in:
@@ -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():
|
||||
|
||||
@@ -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__)
|
||||
Reference in New Issue
Block a user