zeusops / operationbot

A bot for handling events on the Zeusops discord server
GNU General Public License v3.0
7 stars 4 forks source link

Add sample pytest using dpytest framework #98

Open OverkillGuy opened 2 years ago

OverkillGuy commented 2 years ago

New test file, attempting to run the bot in controlled environment (mocked messages) to confirm features work.

Such a test harness will prove important to avoid regressions in future, when migrating from one bot library to another.

As seen in test comments, it's not fully ready (I don't know the codebase enough) but this already has value, both in showing how to set up tests, and by "chafing" enough that we can see what's worth improving.

I took the liberty of adding poetry, but that's personal preference, no huge reason to change what works.

Intent here is to showcase technology, not straight up adoption as PR, hence marking draft.


RCT A. Jib

Gehock commented 2 years ago

Looks really interesting! I figured a way to prevent the bot from crashing during fetch_data, but for some reason the assert still fails.