Orchestrata Ultimate › Tests › Reference › scripts › test_migrate_legacy_story_ids_coverage

Tests reference — tests/scripts/test_migrate_legacy_story_ids_coverage.py

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

Prose pending.

tests/scripts/test_migrate_legacy_story_ids_coverage.py

source · 16 tests · 215 lines

Additional branch coverage for scripts/migrate_legacy_story_ids.py.

Kind Name Line Description
class TestReportCollisions 29
method TestReportCollisions.test_report_collisions_with_known_benign_only 30 Exit 0 when all collisions are in KNOWN_BENIGN_COLLISIONS.
method TestReportCollisions.test_report_collisions_with_unrecognised 39 Exit 1 and print UNRECOGNISED tag for a new collision.
method TestReportCollisions.test_report_collisions_empty_tree 48 No collisions at all → exit 0, 'collisions: 0'.
method TestReportCollisions.test_report_collisions_mixed_known_and_unknown 55 Both known-benign and unknown collisions present → exit 1.
class TestRunSkipsFilesWithNoLegacyIds 69
method TestRunSkipsFilesWithNoLegacyIds.test_run_skips_canonical_only_files 70 A file containing only canonical ids contributes 0 substitutions.
method TestRunSkipsFilesWithNoLegacyIds.test_run_all_canonical_zero_changes 79 All files already canonical → 0 changes.
class TestRunHandlesUnreadableFiles 93
method TestRunHandlesUnreadableFiles.test_find_collisions_skips_unreadable_file 94 A file that cannot be decoded is silently skipped in find_collisions.
method TestRunHandlesUnreadableFiles.test_run_skips_unreadable_file 104 A binary file increments the skipped counter in run().
class TestRunHandlesWriteFailure 118
method TestRunHandlesWriteFailure.test_run_skips_file_that_cannot_be_written 119 A read-only file increments the skipped counter.
class TestIsExcludedValueErrorPath 137
method TestIsExcludedValueErrorPath.test_absolute_path_outside_root_triggers_fallback 138 An absolute path not under root triggers the ValueError fallback.
method TestIsExcludedValueErrorPath.test_absolute_path_under_excluded_dir_in_other_tree 153 ValueError fallback still checks dir parts.
class TestMainDryRunMessage 167
method TestMainDryRunMessage.test_dry_run_prints_rerun_hint 168 Dry run must print 'Re-run with --apply to write.'
method TestMainDryRunMessage.test_apply_does_not_print_rerun_hint 177 Apply mode must NOT print the rerun hint.
class TestManglingErrorClass 190
method TestManglingErrorClass.test_mangling_error_is_runtime_error 191
method TestManglingErrorClass.test_mangling_error_can_be_raised 195
class TestMainUnknownCollisionRefuses 206
method TestMainUnknownCollisionRefuses.test_unknown_collision_exit_2_with_stderr 207