Compare commits
No commits in common. "6acb2041f246ad62c544c30dff97101a53f411cc" and "79a0e524a7baaade6f4f6bf50a6320b7641ae992" have entirely different histories.
6acb2041f2
...
79a0e524a7
1 changed files with 2 additions and 23 deletions
|
|
@ -394,27 +394,6 @@ def test_migrate_preserves_non_dept_sub_and_non_running_pipelines():
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Schema KIN-OBS-014: pid INTEGER присутствует в SCHEMA-строке CREATE TABLE pipelines
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
def test_schema_string_contains_pid_integer_in_pipelines_ddl():
|
|
||||||
"""Регрессия KIN-OBS-014: SCHEMA-строка содержит 'pid INTEGER' в теле CREATE TABLE pipelines.
|
|
||||||
|
|
||||||
До фикса поле было только в _migrate(), но отсутствовало в SCHEMA —
|
|
||||||
при свежей инициализации БД колонка не создавалась.
|
|
||||||
Тест парсит блок CREATE TABLE pipelines напрямую из SCHEMA.
|
|
||||||
"""
|
|
||||||
from core.db import SCHEMA
|
|
||||||
start = SCHEMA.index("CREATE TABLE IF NOT EXISTS pipelines")
|
|
||||||
end = SCHEMA.index(");", start) + 2
|
|
||||||
pipelines_ddl = SCHEMA[start:end]
|
|
||||||
assert "pid INTEGER" in pipelines_ddl, (
|
|
||||||
"pid INTEGER не найден в SCHEMA CREATE TABLE pipelines — "
|
|
||||||
"поле должно быть в SCHEMA (core/db.py строки ~133-148), а не только в _migrate()"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Schema KIN-OBS-018: pid INTEGER присутствует в таблице pipelines
|
# Schema KIN-OBS-018: pid INTEGER присутствует в таблице pipelines
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
@ -429,7 +408,7 @@ class TestPipelinesSchemaKinObs018:
|
||||||
def test_pid_defaults_to_null(self, conn):
|
def test_pid_defaults_to_null(self, conn):
|
||||||
"""Вставка pipeline без pid — значение NULL."""
|
"""Вставка pipeline без pid — значение NULL."""
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"INSERT INTO projects (id, name, path) VALUES ('p_pid', 'P', '/p')"
|
"INSERT INTO projects (id, name) VALUES ('p_pid', 'P')"
|
||||||
)
|
)
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"INSERT INTO tasks (id, project_id, title) VALUES ('t_pid', 'p_pid', 'T')"
|
"INSERT INTO tasks (id, project_id, title) VALUES ('t_pid', 'p_pid', 'T')"
|
||||||
|
|
@ -447,7 +426,7 @@ class TestPipelinesSchemaKinObs018:
|
||||||
def test_pid_can_store_integer_value(self, conn):
|
def test_pid_can_store_integer_value(self, conn):
|
||||||
"""Вставка pipeline с pid — значение сохраняется в БД."""
|
"""Вставка pipeline с pid — значение сохраняется в БД."""
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"INSERT INTO projects (id, name, path) VALUES ('p_pid2', 'P', '/p')"
|
"INSERT INTO projects (id, name) VALUES ('p_pid2', 'P')"
|
||||||
)
|
)
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"INSERT INTO tasks (id, project_id, title) VALUES ('t_pid2', 'p_pid2', 'T')"
|
"INSERT INTO tasks (id, project_id, title) VALUES ('t_pid2', 'p_pid2', 'T')"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue