Ajout de nouveaux tests. Closes #10
This commit is contained in:
parent
dc8edcf4c8
commit
65077926c6
@ -1,6 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
from review.stats import ReviewStats
|
||||||
from tests.utils import bot, OWNER, SENDER
|
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", "test")
|
||||||
bot.test_public_message(bot.channel, "lllll", "!fin")
|
bot.test_public_message(bot.channel, "lllll", "!fin")
|
||||||
bot.test_public_message(bot.channel, "lllll", "!stats")
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user