66from dice_notation .parser import DiceParser
77
88"""
9- Dice parser tests for purely numeric expressions.
9+ Dice parser tests for numeric expressions, validating the output class .
1010"""
1111
1212__author__ = 'Bernardo Martínez Garrido'
1515
1616class TestRollable (unittest .TestCase ):
1717 """
18- Tests that the parser can work with pure numeric operations .
18+ Tests that numeric expressions return instances of Rollable .
1919 """
2020
2121 def setUp (self ):
@@ -26,23 +26,23 @@ def setUp(self):
2626
2727 def test_number_rollable (self ):
2828 """
29- Tests that a simple dice notation can be parsed .
29+ Tests that parsing numbers returns a Rollable .
3030 """
3131 result = self .parser .parse ("1" )
3232
3333 self .assertTrue (isinstance (result , Rollable ))
3434
3535 def test_add_rollable (self ):
3636 """
37- Tests that a simple dice notation can be parsed .
37+ Tests that parsing numeric additions returns a Rollable .
3838 """
3939 result = self .parser .parse ("1+2" )
4040
4141 self .assertTrue (isinstance (result , Rollable ))
4242
4343 def test_sub_rollable (self ):
4444 """
45- Tests that a simple dice notation can be parsed .
45+ Tests that parsing numeric subtractions returns a Rollable .
4646 """
4747 result = self .parser .parse ("1-2" )
4848
@@ -51,7 +51,7 @@ def test_sub_rollable(self):
5151
5252class TestRoll (unittest .TestCase ):
5353 """
54- Tests that the parser can work with pure numeric operations .
54+ Tests that rolling the result from parsing numeric expressions returns the expected value .
5555 """
5656
5757 def setUp (self ):
@@ -60,25 +60,25 @@ def setUp(self):
6060 """
6161 self .parser = DiceParser ()
6262
63- def test_number_rollable (self ):
63+ def test_number_roll (self ):
6464 """
65- Tests that a simple dice notation can be parsed .
65+ Tests that rolling a parsed number returns the expected value .
6666 """
6767 result = self .parser .parse ("1" )
6868
6969 self .assertEqual (1 , result .roll ())
7070
71- def test_add_rollable (self ):
71+ def test_add_roll (self ):
7272 """
73- Tests that a simple dice notation can be parsed .
73+ Tests that rolling a parsed numeric addition returns the expected value .
7474 """
7575 result = self .parser .parse ("1+2" )
7676
7777 self .assertEqual (3 , result .roll ())
7878
79- def test_sub_rollable (self ):
79+ def test_sub_roll (self ):
8080 """
81- Tests that a simple dice notation can be parsed .
81+ Tests that rolling a parsed numeric subtraction returns the expected value .
8282 """
8383 result = self .parser .parse ("1-2" )
8484
0 commit comments