From 968d5349df5d8618f21388115505fdc48de9e6fc Mon Sep 17 00:00:00 2001 From: ctmbl Date: Sun, 15 Oct 2023 19:18:00 +0200 Subject: [PATCH] Add a test for the new help command --- tests/test_cog.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_cog.py b/tests/test_cog.py index b754917..7dd4870 100644 --- a/tests/test_cog.py +++ b/tests/test_cog.py @@ -2,11 +2,14 @@ import copy import pytest +import discord import discord.ext.test as dpytest from data import auteurs_example_data +## NOTE: to debug: print(dpytest.get_messages().content) + @pytest.mark.asyncio async def test_adduser_command(config_bot): # if the API Manager is not rightly mocked this test should fail, on purpose! @@ -29,6 +32,18 @@ async def test_getuser_command(config_bot): assert dpytest.verify().message().contains().content("Points: 3040") +@pytest.mark.asyncio +async def test_help_command(config_bot): + ### + # comments are the same than for test_adduser_command you should check it out + ### + await dpytest.message("!help") + + embedded_help_words = ["adduser", "addusers", "getuser", "help", "status"] + for word in embedded_help_words: + assert dpytest.verify().message().peek().contains().content(word) + + @pytest.mark.asyncio async def test_getuser_not_found(config_bot): ###