Orchestrata Ultimate › Tests › Reference › test_orchestrata_tools_testgen_units

Tests reference — tests/test_orchestrata_tools_testgen_units.py

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

Prose pending.

tests/test_orchestrata_tools_testgen_units.py

source · 96 tests · 1066 lines

Direct pure-function unit tests for the restored

Kind Name Line Description
function test_analyse_empty_condition_returns_empty 65
function test_analyse_syntax_error_returns_empty 72
function test_analyse_is_none 78
function test_analyse_is_not_none 84
function test_analyse_not_negates_inner 90
function test_analyse_eq_int 98
function test_analyse_eq_bool_true 104
function test_analyse_eq_bool_false 110
function test_analyse_eq_none_uses_sentinel_for_other 116
function test_analyse_eq_string 122
function test_analyse_eq_float_falls_back_to_sentinel 128 A non-int constant that also isn't 0/True/False/None/string ('3.14')
function test_analyse_noteq 136
function test_analyse_lt 142
function test_analyse_lte 148
function test_analyse_gt 154
function test_analyse_gte 160
function test_analyse_in 166
function test_analyse_not_in 173
function test_analyse_isinstance 179
function test_analyse_hasattr 186
function test_analyse_bare_name_truthy_falsy_str 193
function test_analyse_bare_name_truthy_falsy_int 199
function test_analyse_bare_name_truthy_falsy_float 205
function test_analyse_bare_name_truthy_falsy_list 211
function test_analyse_bare_name_truthy_falsy_dict 217
function test_analyse_bare_name_truthy_falsy_optional 223
function test_analyse_bare_name_unresolved_annotation_falls_back 228
function test_analyse_attribute_access 234
function test_analyse_bool_and 242
function test_analyse_bool_or 248 _falsy has no explicit "bool" case (only str/int/float/list/dict),
function test_analyse_unrecognised_expression_returns_empty 259 An expression shape the dispatcher has no case for (e.g. a bare
function test_sentinel_custom_override_wins 273
function test_sentinel_none_annotation 278
function test_sentinel_optional_bracket_syntax 282
function test_sentinel_literal 287
function test_sentinel_callable 291
function test_sentinel_type_bracket 295
function test_sentinel_unresolved_type_is_cast_fallback 301
function test_sentinel_needs_cast_true_for_unresolved 305
function test_sentinel_needs_cast_false_for_known_scalar 309
function test_sentinel_imports_none_annotation 313
function test_sentinel_imports_known_type 317
function test_sentinel_imports_unresolved_type 321
function test_invalid_sentinel_none_annotation 325
function test_invalid_sentinel_str 329
function test_invalid_sentinel_int 333
function test_invalid_sentinel_bool 337
function test_invalid_sentinel_container 341
function test_invalid_sentinel_unresolved 345
function test_parametrize_values_none_annotation 349
function test_parametrize_values_str 353
function test_parametrize_values_int 358
function test_parametrize_values_float 362
function test_parametrize_values_bool 366
function test_parametrize_values_list 370
function test_parametrize_values_fallback_repeats_sentinel 374
function test_get_config_known_name_returns_the_shared_instance 386
function test_get_config_unknown_name_returns_default 390
function test_get_config_none_returns_default 396
function test_code_builder_todo_with_and_without_hint 406
function test_code_builder_pytest_raises_block 415
function test_code_builder_str_matches_render 425
function test_code_builder_func_with_decorators_and_async 431
function test_test_file_add_typing_import_renders_from_typing_line 441
function test_test_file_add_import_renders_import_line 450
function test_sentinel_value_is_a_thin_wrapper_over_sentinel 464
function test_const_repr_falls_back_to_ellipsis_on_unparse_failure 468
function test_comparison_values_unrecognised_op_uses_generic_fallback 481
function test_find_class_node_no_match_returns_none 499
function test_find_function_node_no_match_returns_none 505
function test_args_info_from_ast_untyped_args 511 No annotations at all — the ternary's else None arm.
function test_args_info_from_ast_typed_with_defaults_and_kwonly 524
function test_looks_abstract_via_mixin_no_bases_is_false 540
function test_looks_abstract_via_mixin_base_present_but_not_the_pattern 553
function test_looks_abstract_via_mixin_unreadable_base_file_is_skipped 577 The base's file_path points nowhere — Path.read_text raises
function test_safe_unparse_falls_back_to_ellipsis_on_failure 603 Every real call site feeds _safe_unparse a node lifted straight
function test_enum_members_from_node_skips_underscore_prefixed 614 _enum_members_from_node treats a single-leading-underscore name
function test_enum_members_from_node_annassign_member 629
function test_enum_members_from_node_skips_chained_assignment 637 TWO = THREE = 3 has two targets — neither the Assign nor the
function test_enum_members_from_node_auto_value 648
function test_class_structural_extra_protocol_skips_underscore_class_var 656 A Protocol's underscore-prefixed class var is excluded from
function test_generate_tests_module_without_classes_or_functions_is_skipped 745
function test_generate_tests_missing_tree_is_skipped 760 A module present in codebase.modules but absent from trees
function test_generate_tests_non_importable_module_is_skipped 779 A module whose import raises at runtime (valid syntax, but a
function test_generate_tests_combined_file_mode 803 per_module=False writes ONE combined file for every targeted
function test_generate_tests_testfile_hook_runs_per_module_file 842
function test_generate_tests_entry_point_stubs_enabled 870
function test_generate_tests_private_class_is_skipped 890
function test_generate_tests_no_sections_added_returns_empty 918 A plain (non-structural) class with branch tests AND entry-point
function test_generate_tests_all_exports_widens_rather_than_narrows_imports 941 Restoration bug found and fixed here (see _public_names's
function test_print_ranking_prints_a_table 982
function test_public_names_import_failure_falls_back_to_ast_derived_names 993 Called directly with an import path that cannot resolve at all —
function test_gen_branch_tests_missing_class_node_falls_back_to_bare_constructor 1025 class_node=None (the owning class couldn't be located in the
function test_collect_events_stops_past_max_depth 1046
function test_try_unparse_falls_back_to_question_mark_on_failure 1053
function test_exc_class_none_defaults_to_exception 1062