Epub now contains character sheets information.

This commit is contained in:
Mark Wolfman
2021-07-11 09:13:55 -05:00
parent 50754f7d5d
commit 8be06d2ffe
17 changed files with 430 additions and 104 deletions
+29
View File
@@ -56,11 +56,40 @@ class EpubOutputTestCase(unittest.TestCase):
gm_epub = Path(f"{GMFILE.stem}.epub").resolve()
char_epub = Path(f"{CHARFILE.stem}.epub").resolve()
def new_character(self):
char = character.Character(
name="Dr. Who",
classes=["Monk", "Druid", "Artificer"],
levels=[1, 1, 1],
subclasses=["way of the open hand", None, None],
magic_items=["cloak of protection"],
spells=["invisibility"],
wild_shapes=["crocodile"],
infusions=["boots of the winding path"]
)
return char
def tearDown(self):
for f in [self.gm_epub, self.char_epub]:
if f.exists():
f.unlink()
def test_character_html_content(self):
my_char = self.new_character()
html = make_sheets.make_character_content(character=my_char,
content_format="html")
html = "".join(html)
# Make sure the various sections get rendered
self.assertIn("Subclasses</h1>", html)
self.assertIn("Features</h1>", html)
self.assertIn("Magic Items</h1>", html)
self.assertIn("Spells</h1>", html)
self.assertIn("Infusions</h1>", html)
self.assertIn("Known Beasts</h1>", html)
# Check the character sheet
self.assertIn("Character Sheet</h1>", html)
self.assertIn("Dr. Who", html)
def test_gm_file_created(self):
# Check that a file is created once the function is run
make_sheets.make_gm_sheet(gm_file=GMFILE, output_format="epub")