From 16cd672fc465b562af01cb479fa39f9b38222015 Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Tue, 17 Mar 2026 18:35:17 +0200 Subject: [PATCH] =?UTF-8?q?kin:=20KIN-INFRA-008=20=D0=94=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B8=D0=BD=D0=B4=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D1=8B=20=D0=BD=D0=B0=20project=5Flinks=20=D0=B8=20unit-=D1=82?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D1=8B=20deploy=5Fwith=5Fdependents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_models.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index 715ce24..4a80e61 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -843,6 +843,24 @@ def test_write_log_extra_dict_decoded(pipeline_conn): assert entry["extra_json"]["model"] == "sonnet" +def test_write_log_custom_ts_stored_exactly(pipeline_conn): + """KIN-OBS-025: write_log с ts='...' сохраняет переданный timestamp без изменений (UTC-naive).""" + db, pid = pipeline_conn + custom_ts = "2026-03-17T10:00:05" + entry = models.write_log(db, pid, "PM start: task planning", ts=custom_ts, extra={"role": "pm"}) + assert entry["ts"] == custom_ts + + +def test_write_log_no_ts_uses_db_default(pipeline_conn): + """KIN-OBS-025: write_log без ts — таймстемп заполняется БД (не None).""" + db, pid = pipeline_conn + entry = models.write_log(db, pid, "Regular entry") + assert entry["ts"] is not None + # DB default — UTC-naive ISO string, no timezone suffix + assert "+" not in entry["ts"] + assert "Z" not in entry["ts"] + + def test_get_pipeline_logs_since_id_zero_returns_all(pipeline_conn): """KIN-084: get_pipeline_logs(since_id=0) возвращает все записи.""" db, pid = pipeline_conn