This commit is contained in:
Your Name
2026-09-10 15:19:17 +08:00
parent 27fbef9321
commit 36975c6c1b
487 changed files with 15696 additions and 78 deletions
+9
View File
@@ -46,6 +46,15 @@ def test_format_record_time_with_datetime_returns_minute_precision() -> None:
assert format_record_time(date(2026, 8, 20)) == "2026-08-20"
def test_format_record_time_with_unset_epoch_returns_default() -> None:
# The API sends 0 (and occasionally "0") for a snapshot cutoff or finish time that does
# not exist yet; it must not be rendered as a bare 0 or as 1970.
assert format_record_time(0) == ""
assert format_record_time("0") == ""
assert format_record_time(-1) == ""
assert format_record_time(0, default="未开始") == "未开始"
def test_format_record_time_with_garbage_returns_raw_value() -> None:
assert format_record_time("not-a-timestamp") == "not-a-timestamp"