Orchestrata Ultimate › Tests › Reference › session › test_kg_sync_extended
Tests reference — tests/session/test_kg_sync_extended.py
Module of tests/session, split out because the directory page would be too large.
Prose pending.
tests/session/test_kg_sync_extended.py
source · 27 tests · 1016 lines
Extended coverage tests for session.kg_sync.
Covers: core.graph.retry, session.kg_sync/ (package)
| Kind | Name | Line | Description |
|---|---|---|---|
| class | TestRunErrorHandling |
202 | Tests for _run and _run_chunk exception paths. |
| method | TestRunErrorHandling.test_run_invalid_cypher_raises |
205 | Invalid Cypher raises and triggers rollback in _run (lines 225-230). |
| method | TestRunErrorHandling.test_run_batch_empty_returns_empty |
212 | _run_batch short-circuits with empty list. |
| method | TestRunErrorHandling.test_run_chunk_invalid_cypher_raises |
219 | Invalid Cypher in _run_chunk raises Neo4jError after rollback (lines 265-297). |
| method | TestRunErrorHandling.test_run_chunk_unserializable_batch_raises |
230 | Non-serializable batch in _run_chunk hits generic Exception path (lines 298-300). |
| method | TestRunErrorHandling.test_run_chunk_deadlock_retry |
241 | A genuine write conflict between _run_chunk's own transaction and |
| class | TestSyncAllErrorHandling |
354 | Tests for sync_all catching stage exceptions. |
| method | TestSyncAllErrorHandling.test_sync_all_not_connected |
357 | sync_all catches RuntimeError from each stage when not connected (lines 337-338). |
| class | TestLatestModifiedFileEdgeCases |
370 | Edge case tests for latest_modified_file. |
| method | TestLatestModifiedFileEdgeCases.test_broken_symlink_skipped |
373 | Broken symlinks are skipped without crashing. |
| class | TestCollectFileBatchEdgeCases |
387 | Tests for _collect_file_batch error paths. |
| method | TestCollectFileBatchEdgeCases.test_unreadable_file_skipped |
390 | Files that cannot be read are skipped with OSError caught (lines 468-469). |
| class | TestCollectModulePathsEdgeCases |
417 | Tests for _collect_module_paths IGNORE_DIRS handling. |
| method | TestCollectModulePathsEdgeCases.test_init_in_ignored_dir_skipped |
420 | init.py inside IGNORE_DIRS is not counted as a module (line 490). |
| class | TestCodeDeltaDetect |
438 | Tests for _code_delta_detect error handling. |
| method | TestCodeDeltaDetect.test_delta_detect_not_connected |
441 | _code_delta_detect catches exceptions when not connected (lines 632-633). |
| class | TestCodeDeleteStale |
451 | Tests for _code_delete_stale delta-sync path (lines 835-843). |
| method | TestCodeDeleteStale.test_delete_stale_removes_and_recreates |
454 | Modifying a file after sync triggers stale deletion and re-creation. |
| class | TestSyncTracesFallback |
496 | Tests for sync_traces fallback via collect_traces (lines 1199-1237). |
| method | TestSyncTracesFallback.test_fallback_collect_traces |
499 | sync_traces falls back to collect_traces when _collected_traces is empty. |
| method | TestSyncTracesFallback.test_fallback_collect_traces_error |
527 | sync_traces fallback catches OSError from collect_traces (lines 1199-1202). |
| class | TestSyncSessionFilesGitEdgeCases |
555 | Tests for sync_session_files git paths (lines 1313-1373). |
| method | TestSyncSessionFilesGitEdgeCases.test_tag_based_diff |
568 | sync_session_files uses tag-based diff when session tag exists (lines 1330-1348). |
| method | TestSyncSessionFilesGitEdgeCases.test_skip_non_py_pl_files |
593 | sync_session_files skips files that are not .py or .pl (line 1352). |
| method | TestSyncSessionFilesGitEdgeCases.test_non_git_directory_returns_ok |
613 | Running on a directory without git returns ok stats (line 1313-1315 path). |
| method | TestSyncSessionFilesGitEdgeCases.test_git_binary_missing_fails_tag_listing |
622 | A missing git executable makes the tag-listing subprocess raise |
| method | TestSyncSessionFilesGitEdgeCases.test_diff_head_timeout_with_no_tags |
635 | When no session tag exists, sync_session_files falls back to |
| method | TestSyncSessionFilesGitEdgeCases.test_uncommitted_staged_file_stays_modified |
672 | A file that is staged but never committed has no "Added" commit in |
| class | TestLogActionCoverage |
745 | Tests for log_action (_stage_session lines 276-308), previously |
| method | TestLogActionCoverage.test_log_action_with_target_creates_relationships |
749 | log_action creates an Action node linked to Session AND, when a |
| method | TestLogActionCoverage.test_log_action_without_target_skips_targets_link |
807 | log_action with no target still creates the Action + LOGGED_ACTION |
| class | TestBatchOperations |
865 | Tests for batch/chunked operation edge cases. |
| method | TestBatchOperations.test_run_batch_large_list_chunks |
868 | _run_batch splits large lists into chunks of BATCH_SIZE. |
| method | TestBatchOperations.test_wire_rel_chunked_multiple_iterations |
880 | _wire_rel_chunked loops when more than BATCH_SIZE relationships exist. |
| class | TestDataTransformationPaths |
928 | Tests for data transformation edge cases in sync stages. |
| method | TestDataTransformationPaths.test_sync_project_unknown_version |
931 | sync_project uses 'unknown' when pyproject.toml is absent. |
| method | TestDataTransformationPaths.test_sync_specs_missing_directory |
958 | sync_specs reports error when specs/ directory is missing. |
| method | TestDataTransformationPaths.test_sync_session_missing_context |
984 | sync_session reports error when context.json is absent. |
| method | TestDataTransformationPaths.test_sync_session_unknown_seq |
1010 | sync_session reports error for unknown session seq. |