Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_cov_knowledge_query_engine

Tests reference — tests/knowledge_graph/test_cov_knowledge_query_engine.py

Module of tests/knowledge_graph, split out because the directory page would be too large.

Prose pending.

tests/knowledge_graph/test_cov_knowledge_query_engine.py

source · 21 tests · 454 lines

Coverage tests for QueryEngine — connected client paths.

Covers: knowledge_graph.graph_client, knowledge_graph.query_engine, knowledge_graph.types

Kind Name Line Description
class TestQueryWithConnectedClient 64 Tests for QueryEngine.query() when a real connected client is available.
method TestQueryWithConnectedClient.test_query_executes_and_caches_result 67
method TestQueryWithConnectedClient.test_query_returns_cached_on_second_call 90
method TestQueryWithConnectedClient.test_query_different_params_not_cached 116
method TestQueryWithConnectedClient.test_query_with_none_parameters_defaults_to_empty 134
method TestQueryWithConnectedClient.test_query_empty_result_is_cached 140
method TestQueryWithConnectedClient.test_query_with_no_client_returns_empty 152
class TestMultiHopWithConnectedClient 164 Tests for QueryEngine.multi_hop() with a real connected client.
method TestMultiHopWithConnectedClient.test_multi_hop_basic_traversal 167
method TestMultiHopWithConnectedClient.test_multi_hop_with_rel_types 190
method TestMultiHopWithConnectedClient.test_multi_hop_empty_results 220
method TestMultiHopWithConnectedClient.test_multi_hop_node_without_name 228 Node missing 'name' — Node() uses empty string fallback.
method TestMultiHopWithConnectedClient.test_multi_hop_no_rel_types 246
method TestMultiHopWithConnectedClient.test_multi_hop_distance_recorded 262 Verify distances are recorded in relationships.
class TestSearchWithConnectedClient 291 Tests for QueryEngine.search() with a real connected client.
method TestSearchWithConnectedClient.test_search_without_node_type 294
method TestSearchWithConnectedClient.test_search_with_node_type 323
method TestSearchWithConnectedClient.test_search_with_custom_limit 340
method TestSearchWithConnectedClient.test_search_no_results 355
method TestSearchWithConnectedClient.test_search_with_no_client_returns_empty 359
method TestSearchWithConnectedClient.test_search_skips_records_without_props 364 Nodes that match but have no properties return empty Node; ensure we still get results.
class TestGetContextWithConnectedClient 383 Tests for QueryEngine.get_context() with a real connected client.
method TestGetContextWithConnectedClient.test_get_context_delegates_to_multi_hop 386
class TestCacheAndClientInteraction 412 Test that caching interacts correctly with real client queries.
method TestCacheAndClientInteraction.test_invalidate_cache_forces_re_query 415
method TestCacheAndClientInteraction.test_cache_eviction_under_load 443