Ajout de nouveaux tests. Closes #10

This commit is contained in:
Mindiell 2024-07-23 21:59:02 +02:00
parent dc8edcf4c8
commit 65077926c6

View File

@ -1,6 +1,7 @@
from datetime import datetime
import shutil
from review.stats import ReviewStats
from tests.utils import bot, OWNER, SENDER
@ -60,3 +61,30 @@ def test_fast_review(bot):
bot.test_public_message(bot.channel, "lllll", "test")
bot.test_public_message(bot.channel, "lllll", "!fin")
bot.test_public_message(bot.channel, "lllll", "!stats")
def test_review_with_one_user_dont_update_stats(bot):
review = ReviewStats("tests/reviews/reviewstats.csv")
review.load()
size = review.size
bot.test_public_message(bot.channel, "lllll", "!start")
bot.test_public_message(bot.channel, "lllll", "# new test")
bot.test_public_message(bot.channel, "lllll", "test")
bot.test_public_message(bot.channel, "lllll", "!fin")
review = ReviewStats("tests/reviews/reviewstats.csv")
review.load()
assert review.size == size
def test_review_with_two_user_update_stats(bot):
review = ReviewStats("tests/reviews/reviewstats.csv")
review.load()
size = review.size
bot.test_public_message(bot.channel, "lllll", "!start")
bot.test_public_message(bot.channel, "lllll", "# new test")
bot.test_public_message(bot.channel, "lllll", "test")
bot.test_public_message(bot.channel, "ooooo", "another test")
bot.test_public_message(bot.channel, "lllll", "!fin")
review = ReviewStats("tests/reviews/reviewstats.csv")
review.load()
assert review.size == (size + 1)