reviewstats: don't write 'None' if duration is unset #11

Closed
pilou wants to merge 1 commits from pilou/hebdobot:reviewstats_keep_current_format into main
First-time contributor

Keep the current reviewstats format: when review duration is unset/unknown, the line contains only two values separated by one tab and then EOL.

I added one test dedicated to ReviewData de/serialization.

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

I checked this update doesn't break the tests:

$ pytest tests/
== test session starts ==
platform linux -- Python 3.12.4, pytest-8.3.1, pluggy-1.5.0
rootdir: /srv/share/src/april/hebdobot.git
plugins: anyio-4.4.0, cov-5.0.0, typeguard-4.3.0
collected 71 items                                                                                                                                                          

tests/test_aliases.py .                                                                                                                                               [  1%]
tests/test_basic_hooks.py ...............                                                                                                                             [ 22%]
tests/test_bot.py ..                                                                                                                                                  [ 25%]
tests/test_complete_review.py ..                                                                                                                                      [ 28%]
tests/test_review_data.py .                                                                                                                                           [ 29%]
tests/test_review_hooks.py ............................................                                                                                               [ 91%]
tests/test_review_stats.py .....                                                                                                                                      [ 98%]
tests/test_topic.py .                                                                                                                                                 [100%]

==  71 passed in 0.35s ==
Keep the current reviewstats format: when review duration is unset/unknown, the line contains only two values separated by one tab and then EOL. I added one test dedicated to `ReviewData` de/serialization. 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` I checked this update doesn't break the tests: <pre> $ pytest tests/ == test session starts == platform linux -- Python 3.12.4, pytest-8.3.1, pluggy-1.5.0 rootdir: /srv/share/src/april/hebdobot.git plugins: anyio-4.4.0, cov-5.0.0, typeguard-4.3.0 collected 71 items tests/test_aliases.py . [ 1%] tests/test_basic_hooks.py ............... [ 22%] tests/test_bot.py .. [ 25%] tests/test_complete_review.py .. [ 28%] tests/test_review_data.py . [ 29%] tests/test_review_hooks.py ............................................ [ 91%] tests/test_review_stats.py ..... [ 98%] tests/test_topic.py . [100%] == 71 passed in 0.35s == </pre>
pilou added 1 commit 2024-07-21 15:35:51 +02:00
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'
Owner

Testing de/serialization is a good idea, but changes are huge comparing to what was the problem don't you think ?

Testing de/serialization is a good idea, but changes are huge comparing to what was the problem don't you think ?
Author
First-time contributor

Note that for the first nine lines of tests/datas/reviewstats_2.csv, there are extraneous spaces at the end of lines (extraneous because there is no such lines in the current reviewstats.csv file).

Note that for the first nine lines of [tests/datas/reviewstats_2.csv](https://forge.april.org/mindiell/hebdobot/src/branch/main/tests/datas/reviewstats_2.csv), there are extraneous spaces at the end of lines (extraneous because there is no such lines in the current `reviewstats.csv` file).
pilou closed this pull request 2024-07-31 02:52:40 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mindiell/hebdobot#11
No description provided.