samuong / alpaca

A local HTTP proxy for command-line tools. Supports PAC scripts and NTLM authentication.
Apache License 2.0
184 stars 31 forks source link

tests: Fix sunday time to properly include timezone #47

Closed camh- closed 4 years ago

camh- commented 4 years ago

The TestWeekdayRange test was failing when run in the UTC or America/Pacific timezone (and probably others). This is because when parsing a timezone name, that name needs to be defined in for the current location - from the time.Parse docs:

When parsing a time with a zone abbreviation like MST, if the zone
abbreviation has a defined offset in the current location, then that
offset is used.

Presumably the name "AEST" used in the reference Sunday time is not defined in other locations.

So use the RFC1123Z format and be explicit about the +1000 offset, rather than relying on the zone abbreviation.

Fixes: #46