kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-17 15:49:37 +02:00
parent 6c2da26b6c
commit 396f5193d3
3 changed files with 66 additions and 1 deletions

View file

@ -2151,3 +2151,26 @@ def test_create_project_with_test_command(client):
conn.close()
assert row is not None
assert row[0] == "npm test"
def test_patch_project_test_command_empty_string_stores_empty(client):
"""KIN-ARCH-008: PATCH с пустой строкой сохраняет пустую строку (не NULL, в отличие от deploy_command)."""
client.patch("/api/projects/p1", json={"test_command": "pytest -v"})
client.patch("/api/projects/p1", json={"test_command": ""})
from core.db import init_db
conn = init_db(api_module.DB_PATH)
row = conn.execute("SELECT test_command FROM projects WHERE id = 'p1'").fetchone()
conn.close()
assert row[0] == ""
def test_get_projects_includes_test_command(client):
"""KIN-ARCH-008: GET /api/projects возвращает test_command — нужно для инициализации фронтенда."""
client.patch("/api/projects/p1", json={"test_command": "cargo test"})
r = client.get("/api/projects")
assert r.status_code == 200
projects = r.json()
p1 = next((p for p in projects if p["id"] == "p1"), None)
assert p1 is not None
assert p1["test_command"] == "cargo test"