kin: KIN-ARCH-006 Добавить autocommit_enabled и obsidian_vault_path в базовый SCHEMA
This commit is contained in:
parent
295a95bc7f
commit
7630736860
4 changed files with 58 additions and 5 deletions
|
|
@ -58,9 +58,9 @@ def test_update_project_tech_stack_json(conn):
|
|||
# -- project_type and SSH fields (KIN-071) --
|
||||
|
||||
def test_create_operations_project(conn):
|
||||
"""KIN-071: operations project stores SSH fields."""
|
||||
"""KIN-071: operations project stores SSH fields. KIN-ARCH-005: path не передаётся."""
|
||||
p = models.create_project(
|
||||
conn, "srv1", "My Server", "",
|
||||
conn, "srv1", "My Server",
|
||||
project_type="operations",
|
||||
ssh_host="10.0.0.1",
|
||||
ssh_user="root",
|
||||
|
|
@ -72,6 +72,7 @@ def test_create_operations_project(conn):
|
|||
assert p["ssh_user"] == "root"
|
||||
assert p["ssh_key_path"] == "~/.ssh/id_rsa"
|
||||
assert p["ssh_proxy_jump"] == "jumpt"
|
||||
assert p["path"] is None
|
||||
|
||||
|
||||
def test_create_development_project_defaults(conn):
|
||||
|
|
@ -521,3 +522,45 @@ def test_update_task_category_preserves_status_and_priority(conn):
|
|||
assert updated["category"] == "UI"
|
||||
assert updated["status"] == "in_progress"
|
||||
assert updated["priority"] == 3
|
||||
|
||||
|
||||
# -- KIN-ARCH-006: autocommit_enabled и obsidian_vault_path в SCHEMA --
|
||||
|
||||
def test_schema_project_has_autocommit_enabled_column(conn):
|
||||
"""KIN-ARCH-006: таблица projects содержит колонку autocommit_enabled."""
|
||||
cols = {r[1] for r in conn.execute("PRAGMA table_info(projects)").fetchall()}
|
||||
assert "autocommit_enabled" in cols
|
||||
|
||||
|
||||
def test_schema_project_has_obsidian_vault_path_column(conn):
|
||||
"""KIN-ARCH-006: таблица projects содержит колонку obsidian_vault_path."""
|
||||
cols = {r[1] for r in conn.execute("PRAGMA table_info(projects)").fetchall()}
|
||||
assert "obsidian_vault_path" in cols
|
||||
|
||||
|
||||
def test_autocommit_enabled_default_is_zero(conn):
|
||||
"""KIN-ARCH-006: autocommit_enabled по умолчанию равен 0."""
|
||||
models.create_project(conn, "p1", "P1", "/p1")
|
||||
p = models.get_project(conn, "p1")
|
||||
assert p["autocommit_enabled"] == 0
|
||||
|
||||
|
||||
def test_obsidian_vault_path_default_is_none(conn):
|
||||
"""KIN-ARCH-006: obsidian_vault_path по умолчанию равен NULL."""
|
||||
models.create_project(conn, "p1", "P1", "/p1")
|
||||
p = models.get_project(conn, "p1")
|
||||
assert p["obsidian_vault_path"] is None
|
||||
|
||||
|
||||
def test_autocommit_enabled_can_be_set_to_one(conn):
|
||||
"""KIN-ARCH-006: autocommit_enabled можно установить в 1 через update_project."""
|
||||
models.create_project(conn, "p1", "P1", "/p1")
|
||||
updated = models.update_project(conn, "p1", autocommit_enabled=1)
|
||||
assert updated["autocommit_enabled"] == 1
|
||||
|
||||
|
||||
def test_obsidian_vault_path_can_be_set(conn):
|
||||
"""KIN-ARCH-006: obsidian_vault_path можно установить через update_project."""
|
||||
models.create_project(conn, "p1", "P1", "/p1")
|
||||
updated = models.update_project(conn, "p1", obsidian_vault_path="/vault/my-notes")
|
||||
assert updated["obsidian_vault_path"] == "/vault/my-notes"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue