mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-19 04:33:26 +02:00
Fixed tests: needed defaults for making character sheets for NPCs (e.g. GM notes).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user