def test_success_datetime_from_timestamp(self, datetime_tuple, timestamp):
"""Test successful calls to datetime_from_timestamp()."""
if os.name == 'nt' and timestamp > TS_3001_LIMIT:
# Skip this test case, due to the lower limit on Windows
return
# Create the expected datetime result (always timezone-aware in UTC)
dt_unaware = datetime(*datetime_tuple)
exp_dt = pytz.utc.localize(dt_unaware)
# Execute the code to be tested
dt = datetime_from_timestamp(timestamp)
# Verify the result
assert dt == exp_dt
评论列表
文章目录