hermes-agent/tests/hermes_cli/test_relative_time.py
Jean Clawd 8d922ddadd fix: normalize imported session timestamps
OpenClaw session imports can leave ISO-8601 timestamps in SessionDB rows.
Normalize legacy string timestamps before rendering or comparing session
activity so session listing and resume surfaces do not crash on imported
history.
2026-04-23 07:43:51 +02:00

10 lines
244 B
Python

import time
from hermes_cli.main import _relative_time
def test_relative_time_accepts_iso_timestamps():
ts = time.time() - 7200
iso = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(ts))
assert _relative_time(iso) == "2h ago"