Nucu-RPG-Bot/tests/bot/discord/commands/test_dice.py

23 lines
719 B
Python
Raw Normal View History

2024-01-24 11:26:30 +00:00
from src.bot.discord.commands.dice import DiceCog
from src.dice.dice import DieExpressionResult, DieRollResult
def test_format_die_result_to_message():
message = DiceCog.format_die_result_to_fields(
DieExpressionResult(
total=25,
dies=[
2024-01-24 12:10:52 +00:00
DieRollResult(
result=10, modifier=5, rolls=[10], type="d", die_number=20
),
DieRollResult(
result=15, modifier=0, rolls=[10, 5], type="d", die_number=20
),
2024-01-24 11:26:30 +00:00
],
),
)
assert message == [
2024-01-24 12:10:52 +00:00
("- #1 🎲 d20", "Res: 10, Mod: 5, Rolls: [10]"),
("- #2 🎲 d20", "Res: 15, Mod: 0, Rolls: [10, 5]"),
2024-01-24 11:26:30 +00:00
]