Fix custom instruction test typing
This commit is contained in:
parent
6a746f1de4
commit
f763f32b04
|
|
@ -1,6 +1,5 @@
|
|||
import signal
|
||||
from datetime import datetime, timezone
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
|
|
@ -234,12 +233,14 @@ class TestCustomInstructions:
|
|||
AsyncMock(),
|
||||
)
|
||||
|
||||
message = SimpleNamespace(
|
||||
message = models.Message(
|
||||
id=1,
|
||||
public_id="msg_1",
|
||||
content="I like tea.",
|
||||
created_at=datetime.now(timezone.utc),
|
||||
peer_name="alice",
|
||||
token_count=4,
|
||||
seq_in_session=1,
|
||||
session_name="session-1",
|
||||
workspace_name="workspace-1",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
from types import SimpleNamespace
|
||||
|
||||
from src import models
|
||||
from src.schemas import MessageConfiguration, ReasoningConfiguration
|
||||
from src.utils.config_helpers import get_configuration
|
||||
|
||||
|
||||
class TestGetConfiguration:
|
||||
def test_preserves_workspace_custom_instructions(self) -> None:
|
||||
workspace = SimpleNamespace(
|
||||
workspace = models.Workspace(
|
||||
name="workspace-1",
|
||||
configuration={
|
||||
"reasoning": {
|
||||
"enabled": True,
|
||||
|
|
@ -21,10 +21,13 @@ class TestGetConfiguration:
|
|||
assert config.reasoning.custom_instructions == "Focus on durable preferences."
|
||||
|
||||
def test_message_custom_instructions_override_session_and_workspace(self) -> None:
|
||||
workspace = SimpleNamespace(
|
||||
workspace = models.Workspace(
|
||||
name="workspace-1",
|
||||
configuration={"reasoning": {"custom_instructions": "workspace scope"}}
|
||||
)
|
||||
session = SimpleNamespace(
|
||||
session = models.Session(
|
||||
name="session-1",
|
||||
workspace_name="workspace-1",
|
||||
configuration={"reasoning": {"custom_instructions": "session scope"}}
|
||||
)
|
||||
message = MessageConfiguration(
|
||||
|
|
|
|||
Loading…
Reference in New Issue