from __future__ import annotations import pytest from schemas.domain.automation import AutomationJobConfig from v1.auth.automation_static_config import load_static_automation_job_config def test_memory_extraction_static_config_has_expected_defaults() -> None: config = load_static_automation_job_config(config_name="memory_extraction") assert "memory.write" in (config.enabled_tools or []) assert "memory.forget" in (config.enabled_tools or []) assert config.context is not None assert config.context.source.value == "latest_chat" assert config.schedule is not None assert config.schedule.type.value == "daily" def test_automation_job_config_rejects_missing_weekdays_for_weekly() -> None: with pytest.raises(ValueError, match="weekdays is required"): AutomationJobConfig.model_validate( { "enabled_tools": ["calendar.read"], "input_template": "x", "context": { "source": "latest_chat", "window_mode": "day", "window_count": 2, }, "schedule": { "type": "weekly", "run_at": {"hour": 9, "minute": 0}, }, } )