def test_get_hunger_dice_as_text(results, expected):
    dice_pool = DicePool()
    dice_pool.results = results

    message = DicePoolMessage(dice_pool)
    result = message.getHungerDiceAsText()
    assert result == expected
def test_get_dice_as_emotes(results, expected):
    dice_pool = DicePool()
    dice_pool.results = results

    message = DicePoolMessage(dice_pool)
    result = message.getDiceAsEmotes(getEmojiMock)
    assert result == expected
def test_get_message_colour(state: DicePoolState, colour):
    dice_pool = DicePool()
    dice_pool.state = state

    message = DicePoolMessage(dice_pool)
    message_colour = message.getMessageColour()

    assert message_colour == colour
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
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    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)
def test_init_dice_pool_message():
    dice_pool = DicePool()
    message = DicePoolMessage(dice_pool)
    assert message.dice_pool is not None