from __future__ import annotations from pathlib import Path def test_memory_automation_job_trigger_exists_in_0004_migration() -> None: migration = ( Path(__file__).resolve().parents[3] / "alembic" / "versions" / "20260319_0004_automation_job_config_for_memory.py" ) content = migration.read_text(encoding="utf-8") assert "INSERT INTO public.automation_jobs" in content assert "'agent_type', 'memory'" in content assert "ux_automation_jobs_owner_memory_active" in content assert "input_template" in content def test_bootstrap_key_replaces_agent_type_unique_anchor() -> None: migration = ( Path(__file__).resolve().parents[3] / "alembic" / "versions" / "20260323_0003_bootstrap_job_key_and_unique_indexes.py" ) content = migration.read_text(encoding="utf-8") assert "bootstrap_key" in content assert "ux_automation_jobs_owner_bootstrap_key_active" in content assert "ux_memories_owner_memory_type" in content assert "DROP INDEX IF EXISTS ux_automation_jobs_owner_memory_active" in content