item4 / yui

YUI is Multi-purposed Slack Bot.
MIT License
30 stars 11 forks source link

Fix leap year problem in age command #136

Closed u1-liquid closed 5 years ago

u1-liquid commented 5 years ago

생일이 윤년의 2월 29일인 경우 올해 생일을 계산하면서 ValueError 예외가 발생합니다.

Traceback

  File "/home/yui/yui/yui/bot.py", line 276, in handle
    return await handler.run(self, event)
  File "/home/yui/yui/yui/box/apps/basic.py", line 92, in run
    return await self._run_message_event(bot, event)
  File "/home/yui/yui/yui/box/apps/basic.py", line 180, in _run_message_event
    res = await self.handler(**kwargs)
  File "/home/yui/yui/yui/apps/date/age.py", line 50, in age
    this_year_birthday = birthday.replace(today.year)
ValueError: day is out of range for month
codecov[bot] commented 5 years ago

Codecov Report

Merging #136 into master will decrease coverage by 1.12%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
- Coverage   60.63%   59.51%   -1.13%     
==========================================
  Files         106      106              
  Lines        5538     5535       -3     
==========================================
- Hits         3358     3294      -64     
- Misses       2180     2241      +61
Impacted Files Coverage Δ
yui/apps/date/age.py 100% <100%> (ø) :arrow_up:
yui/apps/compute/translate.py 38% <0%> (-62%) :arrow_down:
yui/apps/search/book.py 50% <0%> (-50%) :arrow_down:
yui/apps/weather/aqi.py 82.95% <0%> (-17.05%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 40561d6...14b7d56. Read the comment docs.