Update test for timestamp_to_datetime to use a specific UNIX timestamp

This commit is contained in:
Sean Whalen
2026-03-21 17:15:19 -04:00
parent 25b2c64aa8
commit 901bda384f

View File

@@ -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"""