Basic implementation, can fill in some attributes on the character sheet.

This commit is contained in:
Mark Wolfman
2018-03-25 21:08:48 -05:00
parent e823e71fdd
commit 7862d14c9d
14 changed files with 372 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from unittest import TestCase
from dungeonsheets.exceptions import DiceError
from dungeonsheets import dice
class TestDice(TestCase):
def test_read_dice_str(self):
out = dice.read_dice_str('1d6')
self.assertEqual(out.faces, 6)
self.assertEqual(out.num, 1)
# Multiple digits
out = dice.read_dice_str('15d10')
self.assertEqual(out.faces, 10)
self.assertEqual(out.num, 15)
# Check a bad value
with self.assertRaises(DiceError):
dice.read_dice_str('Ed15')