mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-03-26 08:22:45 +00:00
Update test for timestamp_to_datetime to use a specific UNIX timestamp
This commit is contained in:
8
tests.py
8
tests.py
@@ -4008,10 +4008,12 @@ class TestEnvVarConfig(unittest.TestCase):
|
||||
def testTimestampToDatetime(self):
|
||||
"""timestamp_to_datetime converts UNIX timestamp to datetime"""
|
||||
from datetime import datetime
|
||||
dt = parsedmarc.utils.timestamp_to_datetime(0)
|
||||
|
||||
ts = 1704067200
|
||||
dt = parsedmarc.utils.timestamp_to_datetime(ts)
|
||||
self.assertIsInstance(dt, datetime)
|
||||
# Epoch 0 should be Jan 1 1970 in local time
|
||||
self.assertEqual(dt.year, 1970)
|
||||
# Should match stdlib fromtimestamp (local time)
|
||||
self.assertEqual(dt, datetime.fromtimestamp(ts))
|
||||
|
||||
def testTimestampToHuman(self):
|
||||
"""timestamp_to_human returns formatted string"""
|
||||
|
||||
Reference in New Issue
Block a user