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)