CSSS / wall_e

CSSS Discord Bot (Wall-E)
GNU General Public License v3.0
19 stars 18 forks source link

implement unit tests #195

Open modernNeo opened 5 years ago

modernNeo commented 5 years ago

here's a bit of info on how to do it.

https://github.com/Rapptz/discord.py/issues/197

wnfldchen commented 5 years ago

Adding tests has been in the back of my mind for a while. This is exciting.

Yes, I agree with the link that unit tests would involving splitting off the logic into its own functions.

If we ever wanted to do integration/system testing, there might be a way we could mockup by, say, scripting, or, os or network level tricks, but it would be too difficult to maintain.

Also, on the development end, either way we will have to introduce the need to write tests and keep tests up to date.

Id be up for writing unit tests for the existing commands and integrating it with the pipeline, but some of the logic will be quite difficult to test for. We'll see.

modernNeo commented 5 years ago

@wnfldchen my only issue is I wish we could test with context so we could test if stuff like reacting to the image triggers pagination related thing (going back a page and forward a page)

modernNeo commented 5 years ago

also, just an fyi, I have generally worked on all the issue that I opened up but I have neglected work on the website in favor of the bot for too long so this issue will not be worked on by me.

modernNeo commented 5 years ago

using flake8 would help with some formatting for unit tests: https://github.com/LintlyCI/Flake8Rules/issues/14