File size: 1,105 Bytes
2e818da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from app.schemas.graph import NodeData, NodePatch, OrchestratorAction, HTML5VisualPayload
from app.schemas.session import Intention, Session
from app.schemas.journal import JournalEntry, JournalEventType


def test_node_patch_roundtrip():
    patch = NodePatch(node_id="n1", status="completed")
    assert patch.model_dump()["node_id"] == "n1"


def test_orchestrator_action_requires_intent():
    action = OrchestratorAction(intent="STREAM_CHAT", chat_stream_response="hello")
    assert action.graph_patches is None


def test_intention_values():
    assert Intention.LEARN == "learn"
    assert Intention.DRAFT == "draft"


def test_journal_entry_chat():
    entry = JournalEntry(
        project_id="s1",
        node_id="n1",
        event_type=JournalEventType.CHAT_TURN,
        data={"role": "student", "content": "What is entropy?", "citations": []},
    )
    assert entry.event_type == JournalEventType.CHAT_TURN


def test_node_defaults():
    node = NodeData(id="n1", label="Test")
    assert node.status == "ongoing"
    assert node.origin == "curriculum"
    assert node.children_ids == []