aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-02-04Refactored _get_suggestions following Mark's suggestions about inefficiency.Gravatar Shirayuki Nekomata-12/+24
- Matching scores will be calculated once now and stored in the dict `scores`. - Allow `_get_suggestions()` to go through a list of score threshold and return the first list of matching tags that's not empty and above the threshold. This avoid calling the function multiple time like before ( `self._get_suggestions(tag_name, 100) or self._get_suggestions(tag_name, 80)` for example, is calling this function twice, and is inefficient ) - Deleted commented line. - Added `typing` module for more typehints.
2020-02-04Fixed _last_fetch not being updated after each api call.Gravatar Shirayuki Nekomata-4/+6
- Changed type of `self._last_fetch` to `float` and give it the initial value of `0.0` instead of `None` - Assigned `time.time()` to `time_now` to avoid calling this function twice. - Added `self._last_fetch = time_now` after calling the api call.
2020-02-02Update CODEOWNERSGravatar Joseph-1/+1
2020-02-02Update config-default.ymlGravatar Thomas Petersson-0/+1