Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_kg_sync

Tests reference — tests/knowledge_graph/test_kg_sync.py

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

Prose pending.

tests/knowledge_graph/test_kg_sync.py

source · 21 tests · 408 lines

Tests for Knowledge Graph Syncer.

Covers: core.tracing.traceability, session.kg_sync/ (package)

Kind Name Line Description
class TestSyncStats 73 Tests for SyncStats dataclass.
method TestSyncStats.test_empty_stats 76 Empty stats report ok=True.
method TestSyncStats.test_stats_with_errors 82 Stats with errors report ok=False.
method TestSyncStats.test_to_dict 87 to_dict returns expected structure.
class TestKGSyncerOffline 103 Offline tests — validate initialization and helpers.
method TestKGSyncerOffline.test_init 106 Syncer initializes with project root.
method TestKGSyncerOffline.test_connect_failure_returns_false 112 connect() returns False when the graph is unreachable.
method TestKGSyncerOffline.test_close_when_not_connected 123 close() is safe to call when not connected.
method TestKGSyncerOffline.test_decorator_name_extraction 128 _decorator_name extracts names from AST nodes.
method TestKGSyncerOffline.test_is_top_level 138 _is_top_level identifies module-level functions.
class TestKGSyncerIntegration 156 Integration tests against the live graph.
method TestKGSyncerIntegration.test_connect 192 Syncer connects to the graph.
method TestKGSyncerIntegration.test_sync_project 196 sync_project creates a Project node.
method TestKGSyncerIntegration.test_sync_project_idempotent 210 Running sync_project twice does not create duplicates.
method TestKGSyncerIntegration.test_sync_session 220 sync_session creates Session node linked to Project.
method TestKGSyncerIntegration.test_sync_specs 234 sync_specs creates Spec, Requirement, RequirementItem nodes.
method TestKGSyncerIntegration.test_sync_folders 242 sync_folders creates Directory and File nodes.
method TestKGSyncerIntegration.test_sync_code 251 sync_code creates Class and Function nodes.
method TestKGSyncerIntegration.test_sync_docs 261 sync_docs sets has_docstring on Class/Function nodes.
method TestKGSyncerIntegration.test_sync_all 271 sync_all runs all stages without errors.
method TestKGSyncerIntegration.test_sync_all_idempotent 279 Running sync_all twice does not create duplicates.
method TestKGSyncerIntegration.test_log_action 338 log_action creates an Action node linked to Session.
method TestKGSyncerIntegration.test_get_stats 378 get_stats returns node and relationship counts.
method TestKGSyncerIntegration.test_root_connectivity 388 Every node is reachable from the Project root (no orphans).