Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit tests for timezones #30

Open
basil96 opened this issue May 9, 2020 · 0 comments
Open

unit tests for timezones #30

basil96 opened this issue May 9, 2020 · 0 comments
Assignees
Labels
testing Unit tests etc.

Comments

@basil96
Copy link
Owner

basil96 commented May 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Unit tests etc.
Projects
None yet
Development

No branches or pull requests

2 participants