Beispiel #1
0
 def test_all_spells(self):
     # Make sure only spells are returned
     for ThisSpell in all_spells():
         self.assertTrue(
             isinstance(ThisSpell, type),
             f"``all_spells`` returned {ThisSpell} (not a class)",
         )
         self.assertTrue(
             issubclass(ThisSpell, Spell),
             f"``all_spells`` returned {ThisSpell} (not a spell)",
         )
     # Pick a couple of known spells to spot-check for
     all_the_spells = list(all_spells())
     self.assertIn(spells.MagicMissile, all_the_spells)
     self.assertIn(spells.Thunderwave, all_the_spells)
Beispiel #2
0
 def test_rst_all_spells(self):
     for spell in spells.all_spells():
         tex = epub.rst_to_html(spell.__doc__)
         self.assertNotIn("DUadmonition", tex,
                          f"spell {spell} is not valid reStructured text")