Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_cov_knowledge_search

Tests reference — tests/knowledge_graph/test_cov_knowledge_search.py

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

Prose pending.

tests/knowledge_graph/test_cov_knowledge_search.py

source · 28 tests · 547 lines

Tests for SearchEngine — real graph only.

Covers: knowledge_graph.graph_client, knowledge_graph.search

Kind Name Line Description
class TestFullTextSearchPrimary 69 full_text_search via the existing fulltext index on Class nodes.
method TestFullTextSearchPrimary.test_primary_returns_results_from_fulltext_index 72
method TestFullTextSearchPrimary.test_primary_empty_results 90
class TestFullTextSearchFallback 100 Force the exception path by passing a Lucene-invalid query and verify
method TestFullTextSearchFallback.test_fallback_invoked_on_lucene_parse_error 104
method TestFullTextSearchFallback.test_fallback_returns_contains_matches 131 Force fallback via invalid Lucene then verify contains-based match.
method TestFullTextSearchFallback.test_search_count_increments_per_call 156
method TestFullTextSearchFallback.test_neo4j_dialect_override_forces_real_procedure_call_and_falls_back 162 dialect="neo4j" forces the primary CALL db.index.fulltext.query
class TestSearchByTypeConnected 193 Test search_by_type when a real connected client is available.
method TestSearchByTypeConnected.test_search_by_type_returns_results 196
method TestSearchByTypeConnected.test_search_by_type_uses_correct_label 215
method TestSearchByTypeConnected.test_search_by_type_custom_limit 240
method TestSearchByTypeConnected.test_search_by_type_empty_results 253
class TestSearchByRelationshipConnected 264 Test search_by_relationship with a real connected client.
method TestSearchByRelationshipConnected.test_outgoing_relationship_search 267
method TestSearchByRelationshipConnected.test_incoming_relationship_search 286
method TestSearchByRelationshipConnected.test_default_direction_is_outgoing 305
method TestSearchByRelationshipConnected.test_custom_limit 322
method TestSearchByRelationshipConnected.test_incoming_cypher_direction 337
method TestSearchByRelationshipConnected.test_outgoing_with_node_type_labels_the_anchor 353 node_type resolves to a real label on the $node_id side (P2.21):
method TestSearchByRelationshipConnected.test_incoming_with_node_type_labels_the_anchor 377 Same labeled-anchor path on the incoming branch (the OTHER
class TestContainsSearch 400 Test _contains_search fallback method directly.
method TestContainsSearch.test_contains_search_returns_results 403
method TestContainsSearch.test_contains_search_empty_results 419
method TestContainsSearch.test_contains_search_honours_limit 423
class TestSearchCountIntegration 444 Verify search_count increments across all search methods.
method TestSearchCountIntegration.test_count_increments_across_methods 447
method TestSearchCountIntegration.test_count_does_not_increment_when_no_client 454
class TestConstructorAndDisconnected 464 Constructor state + the disconnected-real-client guard paths.
method TestConstructorAndDisconnected.test_init_defaults 472
method TestConstructorAndDisconnected.test_init_with_client 477
method TestConstructorAndDisconnected.test_all_methods_empty_on_disconnected_client 481
method TestConstructorAndDisconnected.test_contains_search_guard_on_no_client 491 _contains_search repeats the connectivity guard for itself (its
method TestConstructorAndDisconnected.test_contains_search_guard_on_disconnected_real_client 499
class TestContainsFallbackLabelScope 507 _contains_search is scoped to the fulltext universe (2026-07-21).
method TestContainsFallbackLabelScope.test_fallback_returns_code_labels_only 517