-
Notifications
You must be signed in to change notification settings - Fork 4
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
Time zone capitilization #164
Conversation
@@ -53,15 +53,21 @@ class TestModelFrameworkMST(SMRFTestCase): | |||
""" | |||
Test timezone handling for MST. | |||
""" | |||
TIMEZONE = pytz.timezone('US/Mountain') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little did I know that MST is the way to go and 'US/Mountain' is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
US/Mountain
will also apply daylight savings time so you can either miss an hour or double up.
|
||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
base_config = copy.deepcopy(cls.base_config) | ||
base_config.cfg['time']['time_zone'] = str(cls.TIMEZONE) | ||
base_config.cfg['time']['time_zone'] = 'MST' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this call need to b changed?
Or did you want to create a more 'real world' input scenario with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a more real world application as we don't typically pass a pytz object. This will also test that the inicheck parser is working. Then TIMEZONE
becomes what is checked against
value: A single string unchanged | ||
""" | ||
|
||
return value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this would be worth opening a ticket for and move into 'inicheck'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we can flip a coin :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got a lower number so you won!
inicheck
parses thetime_zone
value to lowercase, which is fine for UTC but not any other time zones. Added a custom parser that will perform no checking and return the raw string provided.pytz
will error if the timezone cannot be found.