Fixed tests: needed defaults for making character sheets for NPCs (e.g. GM notes).

This commit is contained in:
Mark Wolfman
2022-01-22 14:49:13 -06:00
parent a30dc28100
commit 23b4bd2559
9 changed files with 69 additions and 14 deletions
+13
View File
@@ -8,6 +8,19 @@ class TestStats(TestCase):
self.assertEqual(stats.mod_str(-3), "-3")
self.assertEqual(stats.mod_str(0), "+0")
self.assertEqual(stats.mod_str(2), "+2")
self.assertEqual(stats.mod_str(None), "N/A")
def test_str_to_list(self):
char = character.Character(equipment="a, b, c")
# Regular string
self.assertEqual(stats.str_to_list(char, "equipment"), ["a", "b", "c"])
# Alternate separator
char.equipment = "a; b; c"
self.assertEqual(stats.str_to_list(char, "equipment", sep=";"), ["a", "b", "c"])
# No attribute
self.assertEqual(stats.str_to_list(char, "inventory"), [])
# Not a string
self.assertEqual(stats.str_to_list(char, "hp_max"), char.hp_max)
def test_saving_throw(self):
# Try it with an ST proficiency