def probe(self, character, difficulty): """ Character try to use a skill. """ attribute = getattr(character, self.attribute) dice_roll = d20() total_result = attribute() + dice_roll return total_result >= difficulty
def test_d20(self): for _ in range(0, 100): r = d20() self.assertTrue(r <= 20) self.assertTrue(r >= 1)