mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-01 10:28:27 +02:00
Some more advanced characteristics, different player classes, and a CLI interface.
This commit is contained in:
+6
-10
@@ -4,6 +4,11 @@ from dungeonsheets import stats
|
||||
|
||||
class TestStats(TestCase):
|
||||
|
||||
def test_mod_str(self):
|
||||
self.assertEqual(stats.mod_str(-3), '-3')
|
||||
self.assertEqual(stats.mod_str(0), '0')
|
||||
self.assertEqual(stats.mod_str(2), '+2')
|
||||
|
||||
def test_modifier(self):
|
||||
ranges = [
|
||||
((1,), -5),
|
||||
@@ -30,16 +35,7 @@ class TestStats(TestCase):
|
||||
stat.value = value
|
||||
msg = f"Stat {value} doesn't produce modifier {target} ({stat.modifier})"
|
||||
self.assertEqual(stat.modifier, target, msg)
|
||||
|
||||
def test_modfifier_string(self):
|
||||
stat = stats.Stat()
|
||||
stat.value = 5
|
||||
self.assertEqual(stat.modifier_string, '-3')
|
||||
stat.value = 10
|
||||
self.assertEqual(stat.modifier_string, '0')
|
||||
stat.value = 15
|
||||
self.assertEqual(stat.modifier_string, '+2')
|
||||
|
||||
|
||||
def test_setter(self):
|
||||
"""Verify that this class works as a data descriptor."""
|
||||
# Set up a dummy class
|
||||
|
||||
Reference in New Issue
Block a user