kin: auto-commit after pipeline
This commit is contained in:
parent
396f5193d3
commit
18160de45e
9 changed files with 449 additions and 0 deletions
|
|
@ -2174,3 +2174,28 @@ def test_get_projects_includes_test_command(client):
|
|||
p1 = next((p for p in projects if p["id"] == "p1"), None)
|
||||
assert p1 is not None
|
||||
assert p1["test_command"] == "cargo test"
|
||||
|
||||
|
||||
def test_patch_project_test_command_db_value_verified(client):
|
||||
"""KIN-ARCH-008 decision #318: PATCH test_command сохраняет значение и в response, и в БД."""
|
||||
r = client.patch("/api/projects/p1", json={"test_command": "pytest --tb=short"})
|
||||
assert r.status_code == 200
|
||||
assert r.json()["test_command"] == "pytest --tb=short"
|
||||
|
||||
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] == "pytest --tb=short"
|
||||
|
||||
|
||||
def test_patch_project_test_command_null_returns_400(client):
|
||||
"""KIN-ARCH-008: PATCH с test_command=null (и без других полей) → 400 'Nothing to update'.
|
||||
|
||||
null трактуется как «поле не передано»: has_any=False → 400.
|
||||
Это документирует текущее поведение: нет способа сбросить test_command через PATCH null.
|
||||
"""
|
||||
client.patch("/api/projects/p1", json={"test_command": "npm test"})
|
||||
r = client.patch("/api/projects/p1", json={"test_command": None})
|
||||
assert r.status_code == 400
|
||||
assert "Nothing to update" in r.json()["detail"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue