mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-19 04:33:26 +02:00
Monsters now have a spells attribute that will eventually hold a list of spells.
This commit is contained in:
+12
-1
@@ -1,6 +1,6 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from dungeonsheets import monsters
|
||||
from dungeonsheets import monsters, spells
|
||||
|
||||
|
||||
class AutoGeneratedMonsters(TestCase):
|
||||
@@ -351,3 +351,14 @@ class AutoGeneratedMonsters(TestCase):
|
||||
self.assertEqual(wolf.strength.value, 12)
|
||||
self.assertEqual(wolf.strength.modifier, 1)
|
||||
self.assertEqual(wolf.strength.saving_throw, 1)
|
||||
|
||||
class MonsterSpellcastingTests(TestCase):
|
||||
def test_spells(self):
|
||||
# Check that monster spells can be set, and then resolved to real spell objects
|
||||
class MyMonster(monsters.Monster):
|
||||
spells = ["cure wounds", spells.Bane]
|
||||
|
||||
self.assertIsInstance(MyMonster.spells[0], type,
|
||||
msg="Monster spell is not a class")
|
||||
self.assertTrue(issubclass(MyMonster.spells[0], spells.Spell))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user