MCPcopy Create free account
hub / github.com/python-arq/arq / test_ms_to_datetime_tz

Function test_ms_to_datetime_tz

tests/test_utils.py:154–165  ·  view source on GitHub ↗
(env: SetEnv)

Source from the content-addressed store, hash-verified

152
153
154def test_ms_to_datetime_tz(env: SetEnv):
155 arq.utils.get_tz.cache_clear()
156 env.set('ARQ_TIMEZONE', 'Asia/Shanghai')
157 env.set('TIMEZONE', 'Europe/Berlin') # lower priority as per `timezone_keys`
158 dt = arq.utils.ms_to_datetime(1_647_345_420_000) # 11.57 UTC
159 assert dt.isoformat() == '2022-03-15T19:57:00+08:00'
160 assert dt.tzinfo.zone == 'Asia/Shanghai'
161
162 # should have no effect due to caching
163 env.set('ARQ_TIMEZONE', 'Europe/Berlin')
164 dt = arq.utils.ms_to_datetime(1_647_345_420_000)
165 assert dt.isoformat() == '2022-03-15T19:57:00+08:00'
166
167
168def test_ms_to_datetime_no_tz(env: SetEnv):

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…