aioswitcher icon indicating copy to clipboard operation
aioswitcher copied to clipboard

test_pretty_next_run_with_todays_day_should_return_due_today breaks after midnight

Open mweinelt opened this issue 2 years ago • 7 comments
trafficstars

What happened?

The test test_pretty_next_run_with_todays_day_should_return_due_today breaks breaks when run after midnight. It does not seem increment the day.

Module Version

3.2.2

Device Type

Switcher V2

Firmware Version

n/a

Relevant log output

――――――――― test_pretty_next_run_with_todays_day_should_return_due_today ―――――――――

todays_day = <Days.WEDNESDAY: 'Wednesday'>, one_hour_from_now = '00:04'

    def test_pretty_next_run_with_todays_day_should_return_due_today(todays_day, one_hour_from_now):
        expected_return = f"Due today at {one_hour_from_now}"
>       assert_that(tools.pretty_next_run(one_hour_from_now, {todays_day})).is_equal_to(expected_return)
E       AssertionError: Expected <Due next Wednesday at 00:04> to be equal to <Due today at 00:04>, but was not.

tests/test_schedule_tools.py:52: AssertionError

mweinelt avatar Mar 08 '23 23:03 mweinelt

Thanks for opening your first issue here!

welcome[bot] avatar Mar 08 '23 23:03 welcome[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 07 '23 23:04 stale[bot]

Not stale.

mweinelt avatar Apr 07 '23 23:04 mweinelt

@mweinelt Sorry - I missed this issue. Thank you for reporting this.

I hope to find the time soon to check this. For now, I'll add the help-wanted label, in case someone else will have time.

TomerFi avatar Apr 10 '23 18:04 TomerFi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 10 '23 21:05 stale[bot]

Closing this issue.

stale[bot] avatar May 15 '23 11:05 stale[bot]

Just encountered this issue again today. How about using https://github.com/spulec/freezegun?

mweinelt avatar Mar 02 '24 00:03 mweinelt