def test_format_message(results, expected): dice_pool = DicePool() dice_pool.results = results dice_pool.state = dice_pool.determineState() message = DicePoolMessage(dice_pool) result = message.formatMessage(getEmojiMock) assert result == expected
def roll(self, hunger_dice, regular_dice): dice_pool = DicePool() dice_pool.reroll(hunger_dice, regular_dice, max_reroll_size=self.MAX_REROLL) dice_pool_message = DicePoolMessage(dice_pool) message = dice_pool_message.formatMessage(self._fn_getEmoji) return CommandResult(CommandResultState.SUCCESS, message)
def roll(self, number_of_dice: int, number_of_hunger: int): result = self.validate(number_of_dice, number_of_hunger) if (result.state == CommandResultState.ERROR): return result dice_pool = DicePool() dice_pool.roll(number_of_dice, number_of_hunger) dice_pool_message = DicePoolMessage(dice_pool) message = dice_pool_message.formatMessage(self._fn_getEmoji) return CommandResult(CommandResultState.SUCCESS, message)