M1-T04: converge startup chain onto the single app DB
run_all_migrations() now adopts/initializes only the app DB and returns
{'app': ...}. app/main.py drops the location/poo readiness checks
(ensure_location_db_ready / ensure_poo_db_ready) and their imports;
ensure_runtime_dirs only provisions the app DB path; lifespan still
fail-closes on a missing/unmanaged app DB. Delete the retired
location/poo adopt scripts and the alembic_location / alembic_poo
chains. Update tests to single-DB expectations and drop the obsolete
location/poo adoption + readiness tests.
pytest 95 passed; ruff clean (pre-existing only); a fresh app DB
initialized via scripts.run_migrations contains location + poo_records.
This commit is contained in:
+1
-16
@@ -209,9 +209,6 @@ def test_create_task_posts_expected_payload(monkeypatch: pytest.MonkeyPatch) ->
|
||||
|
||||
|
||||
def test_homeassistant_publish_creates_ticktick_action_task(
|
||||
test_database_urls,
|
||||
ready_location_database,
|
||||
ready_poo_database,
|
||||
auth_database,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
@@ -255,9 +252,6 @@ def test_homeassistant_publish_creates_ticktick_action_task(
|
||||
|
||||
|
||||
def test_ticktick_auth_start_redirects_authenticated_user(
|
||||
test_database_urls,
|
||||
ready_location_database,
|
||||
ready_poo_database,
|
||||
auth_database,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
@@ -291,9 +285,6 @@ def test_ticktick_auth_start_redirects_authenticated_user(
|
||||
|
||||
|
||||
def test_ticktick_auth_callback_persists_token(
|
||||
test_database_urls,
|
||||
ready_location_database,
|
||||
ready_poo_database,
|
||||
auth_database,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
@@ -318,7 +309,7 @@ def test_ticktick_auth_callback_persists_token(
|
||||
assert response.status_code == 303
|
||||
assert response.headers["location"] == "/config?ticktick_oauth=success"
|
||||
|
||||
conn = sqlite3.connect(test_database_urls["app_path"])
|
||||
conn = sqlite3.connect(auth_database["app_path"])
|
||||
try:
|
||||
row = conn.execute(
|
||||
"SELECT value FROM app_config WHERE key = ?",
|
||||
@@ -332,9 +323,6 @@ def test_ticktick_auth_callback_persists_token(
|
||||
|
||||
|
||||
def test_ticktick_auth_callback_redirects_on_invalid_state(
|
||||
test_database_urls,
|
||||
ready_location_database,
|
||||
ready_poo_database,
|
||||
auth_database,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
@@ -356,9 +344,6 @@ def test_ticktick_auth_callback_redirects_on_invalid_state(
|
||||
|
||||
|
||||
def test_ticktick_auth_callback_redirects_when_token_exchange_fails(
|
||||
test_database_urls,
|
||||
ready_location_database,
|
||||
ready_poo_database,
|
||||
auth_database,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user