CSC510-Group-25 / ClassMateBot

This project helps to improve the life of students, TAs and teachers by automating many mundane tasks which are sometimes done manually on Discord. This is release version 3 of the ClassMateBot.
MIT License
0 stars 5 forks source link

Test DMs Sent To Students (RESOLVED) #26

Closed snapcat closed 2 years ago

snapcat commented 2 years ago

For many of the commands, DMs are sent to students for privacy or to keep channels clean. We need a way to test that the messages are being sent as expected. https://github.com/SE21-Team2/ClassMateBot/issues/37

snapcat commented 2 years ago

Strategy: rather than testing the messages received from the bot, it's better to test messages sent by the bot.

Since messages are added to a queue, it's easy to test the last message sent by the bot:

https://github.com/CSC510-Group-25/ClassMateBot/blob/c2802ea97874edc333c3f7f60c17ef7eb1ead5a3/test/test_bot.py#L331-L341

snapcat commented 2 years ago

Resolved.

In the example in the comment above, line 339 is checking the contents of a message that was sent to the user via DM in qanda.py.