aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-02-21 01:05:14 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2020-02-21 01:08:16 +0100
commit395cd5f01d08c4b5ab278ede4baa4c9f15e6e89b (patch)
treed532b6f44bfb37915e505daec7ba4e3f65712732 /_pytest
parentaaa7ed528a47d92c1ed9a1793a6bbde9db07cf5d (diff)
downloadwee-slack-395cd5f01d08c4b5ab278ede4baa4c9f15e6e89b.tar.gz
Make tests work when the timezone is set to UTC
Unfortunately, the date tests of the last commit only work in one time zone. This changes them to work in UTC. If your machine doesn't use UTC, you now have to run the tests like this: TZ=UTC pytest I'm not sure what the best way to avoid requiring this is.
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/test_unfurl.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/_pytest/test_unfurl.py b/_pytest/test_unfurl.py
index 3545332..13ba392 100644
--- a/_pytest/test_unfurl.py
+++ b/_pytest/test_unfurl.py
@@ -104,16 +104,20 @@ import wee_slack
'output': "@othersubteam This is announcement for the dev team"
},
{
- 'input': "Ends <!date^1584573568^{date_num} - {date} - {date_short} - {date_long} at {time} - {time_secs}|Mar 18, 2020 at 23:19 PM>.",
- 'output': "Ends 2020-03-19 - March 19, 2020 - Mar 19, 2020 - Thursday, March 19, 2020 at 00:19 - 00:19:28."
+ 'input': "Ends <!date^1577880000^{date_num} - {date} - {date_short} - {date_long}|Jan 01, 2020>.",
+ 'output': "Ends 2020-01-01 - January 01, 2020 - Jan 01, 2020 - Wednesday, January 01, 2020."
},
{
- 'input': "Ends <!date^1584573568^{date_num} {invalid_token}>.",
- 'output': "Ends 2020-03-19 {invalid_token}."
+ 'input': "Ends <!date^1577880000^{time} - {time_secs}|12:00 PM>.",
+ 'output': "Ends 12:00 - 12:00:00."
},
{
- 'input': "Ends <!date^1584573568^{date_num}^http://github.com>.",
- 'output': "Ends 2020-03-19 (http://github.com)."
+ 'input': "Ends <!date^1577880000^{date_num} {invalid_token}>.",
+ 'output': "Ends 2020-01-01 {invalid_token}."
+ },
+ {
+ 'input': "Ends <!date^1577880000^{date_num}^http://github.com>.",
+ 'output': "Ends 2020-01-01 (http://github.com)."
},
{
'input': "Ends <!date^{}^{{date_pretty}} - {{date_short_pretty}} - {{date_long_pretty}}>.".format(
@@ -131,7 +135,7 @@ import wee_slack
'output': "Ends tomorrow - tomorrow - tomorrow."
},
{
- 'input': "Ends <!date^1577833200^{date_pretty} - {date_short_pretty} - {date_long_pretty}>.",
+ 'input': "Ends <!date^1577880000^{date_pretty} - {date_short_pretty} - {date_long_pretty}>.",
'output': "Ends January 01, 2020 - Jan 01, 2020 - Wednesday, January 01, 2020."
}
))