def test_roll_parser(self): """Roll dice by using string specs""" r = Roller.roll_parser("d1") self.assertEqual(r, 1) r = Roller.roll_parser("1d1") self.assertEqual(r, 1) r = Roller.roll_parser("1d1+1") self.assertEqual(r, 2)
def test_roll_one_die(self): """A single die roll test""" for n in range(10): self.assertTrue(Roller.roll(sides=6) in (1, 2, 3, 4, 5, 6))