31 lines
975 B
Python
31 lines
975 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import pytest
|
||
|
|
|
||
|
|
from schemas.automation.config import AutomationJobConfig, default_memory_job_config
|
||
|
|
|
||
|
|
|
||
|
|
def test_default_memory_job_config_has_expected_defaults() -> None:
|
||
|
|
config = default_memory_job_config()
|
||
|
|
|
||
|
|
assert config.agent_type.value == "memory"
|
||
|
|
assert config.model_code == "qwen3.5-flash"
|
||
|
|
assert config.context.source.value == "latest_chat"
|
||
|
|
|
||
|
|
|
||
|
|
def test_automation_job_config_rejects_non_flash_model() -> None:
|
||
|
|
with pytest.raises(ValueError, match="model_code must be qwen3.5-flash"):
|
||
|
|
AutomationJobConfig.model_validate(
|
||
|
|
{
|
||
|
|
"agent_type": "memory",
|
||
|
|
"model_code": "qwen-plus",
|
||
|
|
"enabled_tools": ["calendar.read"],
|
||
|
|
"input_template": "x",
|
||
|
|
"context": {
|
||
|
|
"source": "latest_chat",
|
||
|
|
"window_mode": "day",
|
||
|
|
"window_count": 2,
|
||
|
|
},
|
||
|
|
}
|
||
|
|
)
|