def test_complex_roll_output(self): d1 = Dice(1, 20) d2 = Dice(2, 4) d3 = Dice(4, 8) roll = Roll([d1, d2, d3], [], Roll.ADVANTAGE) result = roll.roll() expected_output = ('Total: 39\n' '1d20: 13\n' '2d4: 3 | 2, 1\n' '4d8: 23 | 8, 1, 7, 7\n' 'Other roll: 35') self.assertEqual(str(result), expected_output)
def test_simple_roll_output_with_disadvantage(self): roll = Roll([Dice(1, 20)], [], Roll.DISADVANTAGE) result = roll.roll() expected_output = ('1d20: 5\n' 'Other roll: 19') self.assertEqual(str(result), expected_output)
def test_simple_roll_output(self): roll = Roll([Dice(1, 20)], []) result = roll.roll() expected_output = '1d20: 5' self.assertEqual(str(result), expected_output)