Add comment and extract magic number to variable
This commit is contained in:
parent
d03f58417b
commit
37dee02e1c
@ -83,9 +83,13 @@ def test_format_ms_time() -> None:
|
||||
test format_ms_time()
|
||||
:return: None
|
||||
"""
|
||||
date = format_ms_time(1523383321000)
|
||||
# Date 2018-04-10 18:02:01
|
||||
date_in_epoch_ms = 1523383321000
|
||||
date = format_ms_time(date_in_epoch_ms)
|
||||
assert type(date) is str
|
||||
res = datetime.datetime(2018, 4, 10, 18, 2, 1, tzinfo=datetime.timezone.utc)
|
||||
assert date == res.astimezone(None).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
res = datetime.datetime(2017, 12, 13, 8, 2, 1, tzinfo=datetime.timezone.utc)
|
||||
assert format_ms_time(1513152121000) == res.astimezone(None).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
# Date 2017-12-13 08:02:01
|
||||
date_in_epoch_ms = 1513152121000
|
||||
assert format_ms_time(date_in_epoch_ms) == res.astimezone(None).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
|
Loading…
Reference in New Issue
Block a user