Discussion in #27 revealed that our scheduling logic is untested with regard to timezones. We need at least these test cases:
-
WeeklySchedule instance provided with a tzinfo that matches a provided location.
- expectation:
getCivilTwilight should return the appropriate datetime for the location on a given date in the provided tzinfo timezone.
-
WeeklySchedule instance provided with a location and tzinfo=None.
- expectation:
getCivilTwilight should return the appropriate datetime for the provided location on a given date but in the timezone of the caller's OS.
-
WeeklySchedule instance provided with a tzinfo that is different from a provided location.
- expectation:
getCivilTwilight should return the appropriate datetime for the provided location on a given date but in the provided tzinfo timezone.
-
WeeklySchedule instance provided with a location and no tzinfo argument.
- expectation:
getCivilTwilight should return the appropriate datetime for the provided location on a given date but in the UTC timezone.
Choose a few sample dates, locations, and twilight times from timeanddate.com, no fancy web scraping needed.
Bonus: use dates/times/locations where DST is involved. For example, try a location where DST is not practiced (Arizona?) while providing a tzinfo where DST is in effect on the given day.
Discussion in #27 revealed that our scheduling logic is untested with regard to timezones. We need at least these test cases:
WeeklyScheduleinstance provided with atzinfothat matches a provided location.getCivilTwilightshould return the appropriatedatetimefor the location on a given date in the providedtzinfotimezone.WeeklyScheduleinstance provided with a location andtzinfo=None.getCivilTwilightshould return the appropriatedatetimefor the provided location on a given date but in the timezone of the caller's OS.WeeklyScheduleinstance provided with atzinfothat is different from a provided location.getCivilTwilightshould return the appropriatedatetimefor the provided location on a given date but in the providedtzinfotimezone.WeeklyScheduleinstance provided with a location and notzinfoargument.getCivilTwilightshould return the appropriatedatetimefor the provided location on a given date but in the UTC timezone.Choose a few sample dates, locations, and twilight times from timeanddate.com, no fancy web scraping needed.
Bonus: use dates/times/locations where DST is involved. For example, try a location where DST is not practiced (Arizona?) while providing a
tzinfowhere DST is in effect on the given day.