From 65077926c6a106197726e7c209b08ace726636b0 Mon Sep 17 00:00:00 2001 From: Mindiell Date: Tue, 23 Jul 2024 21:59:02 +0200 Subject: [PATCH] Ajout de nouveaux tests. Closes #10 --- tests/test_complete_review.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/test_complete_review.py b/tests/test_complete_review.py index a46c643..b5d88dd 100644 --- a/tests/test_complete_review.py +++ b/tests/test_complete_review.py @@ -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)