Skip to content

Commit

Permalink
Add a test for the new help command
Browse files Browse the repository at this point in the history
  • Loading branch information
ctmbl committed Oct 15, 2023
1 parent 6623dfd commit 968d534
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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):
###
Expand Down

0 comments on commit 968d534

Please sign in to comment.