/
Yan_Yu
/
Nereus
Обзор
Документация
Войти
/
Yan_Yu
/
Nereus
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
working
src/tests/test_graph_workflow.py
51 строка
2 KB
yan
init: scaffold Nereus AI tutoring platform with multi-agent orchestration
02 авг 2026, 18:25
02 авг 2026, 18:25
13d60da
Код
Авторство
О чём код?
"""Tests for the graph workflow assembly.""" import pytest from src.graph.workflow import build_graph, compile_graph class TestGraphAssembly: """Tests for LangGraph workflow construction.""" def test_build_graph_returns_state_graph(self): """Test that build_graph returns a StateGraph instance.""" graph = build_graph() assert graph is not None # StateGraph has a 'nodes' attribute after nodes are added assert hasattr(graph, "nodes") def test_graph_has_all_nodes(self): """Test that all expected nodes are registered.""" graph = build_graph() # Main agent nodes (advance_and_tutor is a helper, not counted as agent) expected_nodes = {"coach", "tutor", "examiner", "deep_dive", "finalize", "advance_and_tutor"} actual_nodes = set(graph.nodes.keys()) assert expected_nodes == actual_nodes, \ f"Expected nodes {expected_nodes}, got {actual_nodes}" def test_graph_compiles_successfully(self): """Test that the graph compiles without errors.""" compiled = compile_graph() assert compiled is not None # Compiled graph should have an invoke method assert hasattr(compiled, "invoke") def test_graph_has_edges(self): """Test that graph has edges defined.""" graph = build_graph() assert hasattr(graph, "edges") assert len(graph.edges) > 0 def test_get_graph_returns_compiled(self): """Test that get_graph returns the compiled graph.""" from src.graph.workflow import get_graph graph = get_graph() assert graph is not None assert hasattr(graph, "invoke")