Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_graph_context_injection
Tests reference — tests/knowledge_graph/test_graph_context_injection.py
Module of tests/knowledge_graph, split out because the directory page would be too large.
Prose pending.
tests/knowledge_graph/test_graph_context_injection.py
source · 26 tests · 372 lines
End-to-end tests for the graph context injection pipeline.
Covers: agents.volks.architect.volk, agents.volks.concierge.volk, agents.volks.qa.volk, core.graph_directives, core.tracing.traceability, knowledge_graph.context_injector, knowledge_graph.synchronizer, llm.client
| Kind | Name | Line | Description |
|---|---|---|---|
| class | TestExtractGraphContext |
38 | Tests for extract_graph_context() in orchestrata_ultimate.core.graph_directives. |
| method | TestExtractGraphContext.test_extracts_from_payload |
42 | payload with graph_context key returns the string. |
| method | TestExtractGraphContext.test_returns_none_when_missing |
49 | payload without graph_context key returns None. |
| method | TestExtractGraphContext.test_returns_none_when_empty |
56 | payload with empty string value returns None. |
| method | TestExtractGraphContext.test_returns_none_when_none |
63 | payload with explicit None value returns None. |
| method | TestExtractGraphContext.test_preserves_content |
74 | Extracted string matches exactly what was placed in the payload. |
| class | TestCallLlmGraphContextInjection |
91 | Tests for graph_context wiring in call_llm and call_reasoner. |
| method | TestCallLlmGraphContextInjection.test_graph_context_none_leaves_message_unchanged |
102 | When graph_context is None, effective_message equals user_message. |
| method | TestCallLlmGraphContextInjection.test_graph_context_prepended |
115 | When graph_context is set, it is prepended to user_message. |
| method | TestCallLlmGraphContextInjection.test_graph_context_separator |
128 | The '---' separator appears between graph_context and user_message. |
| method | TestCallLlmGraphContextInjection.test_graph_context_empty_string_treated_as_none |
142 | Empty string graph_context does not prepend anything. |
| method | TestCallLlmGraphContextInjection.test_call_llm_accepts_graph_context |
154 | call_llm signature has a graph_context parameter. |
| method | TestCallLlmGraphContextInjection.test_call_reasoner_passes_graph_context |
162 | call_reasoner signature accepts graph_context and passes it to call_llm. |
| class | TestContextInjectorToPrompt |
179 | Tests for GraphContext.to_prompt() formatting. |
| method | TestContextInjectorToPrompt.test_prompt_starts_with_header |
183 | Prompt begins with the mandatory knowledge graph header. |
| method | TestContextInjectorToPrompt.test_inheritance_section |
191 | INHERITS relationships appear under the Inheritance heading. |
| method | TestContextInjectorToPrompt.test_calls_section |
206 | CALLS relationships appear under the Call Graph heading. |
| method | TestContextInjectorToPrompt.test_imports_section |
220 | IMPORTS relationships appear under the Import Dependencies heading. |
| method | TestContextInjectorToPrompt.test_methods_section |
233 | DEFINES relationships appear under the Class Methods heading. |
| method | TestContextInjectorToPrompt.test_empty_context_returns_header_only |
247 | GraphContext with no files or relationships produces header-only output. |
| class | TestEnsureFresh |
263 | Tests for FileSynchronizer.ensure_fresh(). |
| method | TestEnsureFresh.test_ensure_fresh_syncs_changed_files |
267 | After modifying a file, ensure_fresh returns 1. |
| method | TestEnsureFresh.test_ensure_fresh_skips_unchanged |
283 | After syncing, ensure_fresh on unmodified project returns 0. |
| method | TestEnsureFresh.test_ensure_fresh_nonexistent_dir |
294 | Passing a nonexistent path returns 0 without raising. |
| method | TestEnsureFresh.test_ensure_fresh_respects_extensions |
301 | Only .py and .pl files are checked — .txt files are ignored. |
| method | TestEnsureFresh.test_ensure_fresh_empty_dir |
315 | Empty project directory returns 0. |
| class | TestVolkGraphContextWiring |
327 | Verify that volk classes correctly extract and forward graph_context. |
| method | TestVolkGraphContextWiring.test_concierge_has_extract |
335 | ConciergeAgent.process() calls extract_graph_context. |
| method | TestVolkGraphContextWiring.test_architect_has_extract |
345 | ArchitectVolk.process() calls extract_graph_context. |
| method | TestVolkGraphContextWiring.test_qa_has_extract |
355 | QAVolk.process() calls extract_graph_context. |
| method | TestVolkGraphContextWiring.test_call_llm_accepts_graph_context |
365 | call_llm has graph_context as a keyword parameter with None default. |