Correctif sur la sauvegarde des statistiques. Closes #9
This commit is contained in:
parent
c4a3e78967
commit
dc8edcf4c8
@ -174,7 +174,10 @@ class ReviewStats:
|
||||
def save(self):
|
||||
with open(self.filepath, "w") as file_handle:
|
||||
for data in self.datas:
|
||||
duration = ""
|
||||
if data.duration is not None:
|
||||
duration = f"\t{data.duration}"
|
||||
file_handle.write(
|
||||
f"{data.date.strftime('%Y%m%d-%Hh%M')}\t"
|
||||
f"{data.user_count}\t{data.duration}\n"
|
||||
f"{data.user_count}{duration}\n"
|
||||
)
|
||||
|
@ -52,3 +52,11 @@ def test_other_review(bot):
|
||||
with open("tests/reviews/20240402-log-irc-revue-hebdomadaire.txt") as file_handle:
|
||||
content_tested = file_handle.read()
|
||||
assert content_ok in content_tested
|
||||
|
||||
|
||||
def test_fast_review(bot):
|
||||
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")
|
||||
bot.test_public_message(bot.channel, "lllll", "!stats")
|
||||
|
Loading…
Reference in New Issue
Block a user