Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_anomaly_detector
Tests reference — tests/knowledge_graph/test_anomaly_detector.py
Module of tests/knowledge_graph, split out because the directory page would be too large.
Prose pending.
tests/knowledge_graph/test_anomaly_detector.py
source · 18 tests · 774 lines
Test Standards Compliance (see AGENTS.md § Test Standards):
Covers: knowledge_graph.anomaly_detector, knowledge_graph.code_parser, knowledge_graph.config, knowledge_graph.graph_client, knowledge_graph.synchronizer
| Kind | Name | Line | Description |
|---|---|---|---|
| class | TestAnomalyTypeEnum |
227 | Test AnomalyType enum values exist. |
| method | TestAnomalyTypeEnum.test_all_six_types_exist |
230 | Verify all 6 anomaly types are defined. |
| class | TestAnomalyDataModels |
243 | Test Anomaly, CorrectionResult, AnomalyReport models. |
| method | TestAnomalyDataModels.test_anomaly_creation |
246 | Verify Anomaly dataclass fields. |
| method | TestAnomalyDataModels.test_correction_result_creation |
260 | Verify CorrectionResult dataclass fields. |
| method | TestAnomalyDataModels.test_anomaly_report_empty |
276 | Verify empty AnomalyReport defaults. |
| class | TestStaleFileDetection |
287 | Test detection of files in graph but not on disk. |
| method | TestStaleFileDetection.test_detects_stale_file |
290 | Create file, sync to graph, delete, detect stale. |
| method | TestStaleFileDetection.test_correct_stale_file_deletes_nodes |
321 | Auto-correct a stale file removes it from graph. |
| class | TestHashMismatchDetection |
359 | Test detection of hash mismatches. |
| method | TestHashMismatchDetection.test_detects_hash_mismatch |
362 | Modify a file and detect hash mismatch. |
| class | TestLineCountDriftDetection |
396 | Test detection of line count drift. |
| method | TestLineCountDriftDetection.test_detects_line_count_drift |
399 | Add lines to a file and detect drift. |
| method | TestLineCountDriftDetection.test_correct_line_count_drift |
439 | Auto-correct updates the line_count property. |
| class | TestOrphanRelationshipDetection |
476 | Test detection of orphan DEFINES relationships. |
| method | TestOrphanRelationshipDetection.test_detects_orphan_class |
479 | Remove a class from file, detect orphan. |
| method | TestOrphanRelationshipDetection.test_correct_orphan_deletes_node |
521 | Auto-correct deletes the orphaned entity node. |
| class | TestReportOnlyMode |
561 | Test that report mode produces no corrections. |
| method | TestReportOnlyMode.test_report_mode_no_corrections |
564 | Report-only audit detects but does not correct. |
| class | TestGraphClientAliasAnomalyMethods |
596 | Test the three new graph_client methods. |
| method | TestGraphClientAliasAnomalyMethods.test_get_project_files_returns_list |
599 | get_project_files returns File node data. |
| method | TestGraphClientAliasAnomalyMethods.test_get_file_entities_returns_entities |
622 | get_file_entities returns classes and functions. |
| method | TestGraphClientAliasAnomalyMethods.test_delete_file_cascade_removes_all |
648 | delete_file_cascade removes file + children. |
| method | TestGraphClientAliasAnomalyMethods.test_update_file_line_count |
674 | update_file_line_count changes the property. |
| class | TestSyncWithAudit |
702 | Test synchronizer.sync_with_audit method. |
| method | TestSyncWithAudit.test_sync_with_audit_returns_tuple |
705 | sync_with_audit returns (results, report). |
| class | TestEndToEndAutoCorrection |
722 | Full cycle: create, sync, mutate, detect, correct. |
| method | TestEndToEndAutoCorrection.test_full_cycle_stale_and_hash |
725 | End-to-end: detect multiple anomaly types, fix all. |