예제 #1
0
 def test_learned_spells(self):
     """For a druid, learning spells is not necessary and this field should
     be ignored."""
     char = Druid()
     with warnings.catch_warnings():
         warnings.filterwarnings("ignore", message="Druids cannot learn spells")
         char.set_attrs(spells=["invisibility"], spells_prepared=["druidcraft"])
     # self.assertEqual(len(char.spells), 1)
     self.assertEqual(len(char.spells), 2)
     self.assertIn(spells.Druidcraft(), char.spells)
예제 #2
0
 def test_learned_spells(self):
     """For a druid, learning spells is not necessary and this field should
     be ignored."""
     char = Druid()
     with warnings.catch_warnings():
         warnings.filterwarnings('ignore',
                                 message="Druids cannot learn spells")
         char.set_attrs(spells=['invisibility'],
                        spells_prepared=['druidcraft'])
     self.assertEqual(len(char.spells), 1)
     self.assertIsInstance(char.spells[0], spells.Druidcraft)