hebdobot/tests/test_review_data.py
Pierre-Louis Bonicoli 919bb59859
reviewstats: don't write 'None' if duration is unset
Keep the current reviewstats format: when review duration is unset/unknown,
the line contains only two values separated by one tab and then EOL.

Another way to test/reproduce the fixed issue:
1. add 'lllll : !stats' to tests/datas/irc.txt
2. run 'pytest tests/test_review_stats.py'
2024-07-21 15:18:52 +02:00

9 lines
276 B
Python

from review.stats import ReviewData
def test_reviewdata():
for filename in ("reviewstats_1.csv", "reviewstats_2.csv"):
with open(f"tests/datas/{filename}", "r") as review:
for line in review:
assert line == str(ReviewData.load(line))