Orchestrata Ultimate › Tests › Reference › scripts › test_ast_core_compare

Tests reference — tests/scripts/test_ast_core_compare.py

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

Prose pending.

tests/scripts/test_ast_core_compare.py

source · 23 tests · 677 lines

Tests for the PORT-CRITICAL comparison/serialization core of the AST tool.

Kind Name Line Description
function test_serialize_round_trips_class_and_function_shape 108 Round-trips classes, methods (all param kinds), and module-level
function test_serialize_passes_through_non_dataclass_unchanged 160 A plain dict (no __dataclass_fields__) is returned as-is.
function test_serialize_deterministic_across_runs 167
function test_walk_order_is_sorted_and_stable_across_many_dirs 182 Regression for the 2026-08-09 os.walk-order reorder defect.
function test_serialize_multi_root_deterministic_and_excludes_nested_distribution 224 Regression: extra_roots ordering + vendored-distribution pruning.
function test_compare_codebases_identical_sources_no_diffs 265 Also covers a module-level function alongside the class, since real
function test_compare_codebases_reports_only_in_each_side 290
function test_compare_codebases_shared_class_method_diff_buckets_correctly 307 An added/removed method on a shared class is bucketed correctly, and
function test_compare_codebases_bases_diff_flagged_even_with_same_methods 340 A base-class change with NO method diff must still surface as a diff
function test_compare_methods_deep_identical_methods_no_param_diffs 365 Real serialized methods for the SAME class compared against
function test_compare_methods_deep_param_type_annotation_diff_reported 386
function test_compare_methods_deep_extra_param_each_side_labeled 397
function test_compare_methods_deep_async_and_return_mismatch 410
function test_compare_methods_deep_only_in_each_side_summarized 426 Methods unique to one side are reported (compactly) instead of
function test_compare_dep_graphs_reports_added_removed_and_shared 457
function test_compare_dep_graphs_submodule_external_dep_collapsed_to_top_package 479
function test_compare_dep_graphs_real_serialized_sources 490 End-to-end: real analyzer output (not hand-built dicts) feeds the
function test_deep_compare_mapping_remaps_rename_to_matched_not_added_removed 514 A class renamed between codebases (OldAgent -> NewAgent) must be
function test_deep_compare_without_mapping_rename_is_added_and_removed 540 Same rename scenario, but with NO mapping supplied: it must show up
function test_deep_compare_same_name_auto_matches_without_mapping 564 Identically-named classes on both sides pair via the exact-name pass
function test_deep_compare_readiness_reflects_method_coverage_ratio 582 Ultimate has 1/4 of orchestrata's methods on the paired class ->
function test_deep_compare_metadata_includes_names_and_mapping_source 606
function test_augment_end_line_and_complexity_reuses_analyzer_trees 629 Regression for backlog #437 / 2026-08-09 audit: