Skip to content

unit tests for timezones #30

@basil96

Description

@basil96

Discussion in #27 revealed that our scheduling logic is untested with regard to timezones. We need at least these test cases:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Metadata

Metadata

Assignees

Labels

testingUnit tests etc.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions