Orchestrata Ultimate › Tests › Reference › session › test_kg_sync_real_graph

Tests reference — tests/session/test_kg_sync_real_graph.py

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

Prose pending.

tests/session/test_kg_sync_real_graph.py

source · 35 tests · 1143 lines

Covers: core.base.traces, session.kg_sync/ (package)

Kind Name Line Description
class TestRunErrorPaths 211 Error paths for _run and _run_batch when not connected.
method TestRunErrorPaths.test_run_without_connection_raises 214 _run raises RuntimeError when no driver is attached.
method TestRunErrorPaths.test_run_batch_without_connection_raises 225 _run_batch raises RuntimeError when no driver is attached.
method TestRunErrorPaths.test_run_batch_empty_returns_empty 236 _run_batch short-circuits with empty list.
method TestRunErrorPaths.test_run_batch_chunks_large_list 241 _run_batch processes batches larger than BATCH_SIZE.
class TestSyncProject 257 Tests for sync_project.
method TestSyncProject.test_creates_project_node 260 sync_project creates exactly one Project node.
method TestSyncProject.test_idempotent 276 Second sync_project does not duplicate the Project node.
method TestSyncProject.test_version_unknown_when_no_pyproject 286 When pyproject.toml is missing, version defaults to 'unknown'.
class TestSyncSession 316 Tests for sync_session.
method TestSyncSession.test_creates_session_node_and_link 319 sync_session creates Session and HAS_SESSION relationship.
method TestSyncSession.test_missing_context_json 340 sync_session reports an error when context.json is absent.
method TestSyncSession.test_seq_not_in_history 347 sync_session reports error for an unknown session seq.
class TestSyncFolders 358 Tests for sync_folders.
method TestSyncFolders.test_creates_directories_and_files 361 sync_folders creates Directory and File nodes plus relationships.
method TestSyncFolders.test_module_label_set 391 src/ is labelled :Module because of init.py.
method TestSyncFolders.test_idempotent 405 Running sync_folders twice does not duplicate File nodes.
method TestSyncFolders.test_file_and_directory_nodes_have_canonical_keys 420 File and Directory nodes are keyed on the project-qualified id
class TestMultiProjectFileDirectoryIsolation 452 Two distinct projects with identical relative paths must not collide.
method TestMultiProjectFileDirectoryIsolation.test_root_directory_and_file_nodes_stay_distinct_per_project 455 Two projects sharing '.' and 'src/module.py' get separate nodes.
class TestMultiProjectSpecRequirementIsolation 553 Two projects that both use spec number "001" must not collapse.
method TestMultiProjectSpecRequirementIsolation.test_spec_and_requirement_item_stay_distinct_per_project 563
class TestSyncCode 656 Tests for sync_code.
method TestSyncCode.test_creates_class_function_method_nodes 659 sync_code creates Class, Function (method + top-level) nodes.
method TestSyncCode.test_relationships_wired 702 sync_code wires File-DEFINES-Class and Class-DEFINES-Function.
method TestSyncCode.test_gathered_traces_populated 717 sync_code stores trace info on the syncer for sync_traces.
method TestSyncCode.test_explicit_files_arg 732 Passing files=[...] limits parsing to that list.
method TestSyncCode.test_delta_sync_skips_unchanged 746 Re-running sync_code with no file changes uses delta detection.
class TestSyncSpecs 766 Tests for sync_specs.
method TestSyncSpecs.test_creates_spec_requirement_item 769 sync_specs creates Spec, Requirement and RequirementItem nodes.
method TestSyncSpecs.test_no_specs_dir 809 sync_specs reports error when specs/ is missing.
method TestSyncSpecs.test_spec_and_requirement_nodes_have_canonical_keys 836 Spec, Requirement and RequirementItem nodes are keyed on the
class TestSyncTraces 867 Tests for sync_traces.
method TestSyncTraces.test_traces_to_relationships_created 870 sync_traces creates TRACES_TO and IMPLEMENTS relationships.
method TestSyncTraces.test_traces_no_data_returns_ok 922 sync_traces with no collected traces and no scan dirs is a no-op.
class TestSyncDocs 936 Tests for sync_docs.
method TestSyncDocs.test_sync_docs_returns_ok 939 sync_docs runs without errors after sync_code.
class TestSyncSessionFiles 962 Tests for sync_session_files (uses git).
method TestSyncSessionFiles.test_sync_session_files_no_git 975 Running on a non-git directory is harmless (returns ok stats).
method TestSyncSessionFiles.test_sync_session_files_with_git 984 With git history present, modified .py files are linked.
class TestSyncAll 1010 Tests for sync_all.
method TestSyncAll.test_sync_all_no_session 1013 sync_all with no session_seq runs all 7 stages.
method TestSyncAll.test_sync_all_with_session 1029 sync_all(seq) includes session and session_files stages.
class TestUpdateFileTraceability 1047 Tests for _update_file_traceability stage.
method TestUpdateFileTraceability.test_traceability_props_set 1050 File nodes acquire spec_count, traced_requirements, has_traces.
class TestLogAction 1078 Tests for log_action.
method TestLogAction.test_log_action_creates_node_and_link 1081 log_action creates Action node, links to Session and target File.
method TestLogAction.test_log_action_no_target 1110 log_action without target still creates Action node.
class TestGetStats 1130 Tests for get_stats.
method TestGetStats.test_get_stats_returns_counts 1133 get_stats returns dict with 'nodes' and 'relationships' keys.