Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_semantic_bridge_coverage

Tests reference — tests/knowledge_graph/test_semantic_bridge_coverage.py

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

Prose pending.

tests/knowledge_graph/test_semantic_bridge_coverage.py

source · 16 tests · 341 lines

Branch-coverage tests for knowledge_graph.semantic_bridge.

Covers: core.graph_factory, knowledge_graph.semantic_bridge, semantic_graph.config, core.graph/ (package)

Kind Name Line Description
class TestFileNameTerms 110 _file_name_terms edge cases (empty path, empty stem).
method TestFileNameTerms.test_skips_empty_paths_and_empty_stems 114
class TestMemgraphDriver 119 _memgraph_driver basic_auth branch.
method TestMemgraphDriver.test_credentials_build_working_driver 123 With username/password set the factory takes the basic_auth path;
class TestQueryNeo4jFiles 141 _query_neo4j_files empty-paths, project_id clause, failure paths.
method TestQueryNeo4jFiles.test_empty_paths_short_circuits 145
method TestQueryNeo4jFiles.test_project_id_scopes_lookup 148 With project_id, the id-list clause and AND project_id filter apply.
method TestQueryNeo4jFiles.test_backend_failure_degrades_to_empty 181 A repository whose driver is already closed raises inside
class TestSnippet 196 SemanticRoot.snippet empty and truncation branches.
method TestSnippet.test_no_chunks_returns_empty 200
method TestSnippet.test_empty_content_returns_empty 204
method TestSnippet.test_long_first_line_is_truncated 209
class TestSearchSemanticRootsBranches 216 search_semantic_roots degrade and skip branches.
method TestSearchSemanticRootsBranches.test_no_extractable_terms_returns_empty 220 Stopword-only / short-token queries yield no terms; the bridge
method TestSearchSemanticRootsBranches.test_no_matching_chunks_returns_empty 229 A well-formed query that matches no chunk content returns [].
method TestSearchSemanticRootsBranches.test_chunk_without_file_path_is_skipped 239 Chunks with a falsy file_path never produce roots; a chunk matched
method TestSearchSemanticRootsBranches.test_assembly_failure_degrades_to_empty 278 A wrong-type max_chunks_per_file raises mid-assembly; the bridge
class TestRenderSemanticRootsBranches 301 render_semantic_roots empty, mixed-membership, trimming branches.
method TestRenderSemanticRootsBranches.test_empty_roots_returns_empty 305
method TestRenderSemanticRootsBranches.test_mixed_kg_membership_lists_only_known_files 309 Roots without a line_count render with the '?' marker and are
method TestRenderSemanticRootsBranches.test_max_lines_trims_output 326
method TestRenderSemanticRootsBranches.test_trimmed_to_header_returns_empty 337 When max_lines trims the block down to just the header, the