Orchestrata Ultimate › Tests › Reference › scripts › test_architecture_checker
Tests reference — tests/scripts/test_architecture_checker.py
Module of tests/scripts, split out because the directory page would be too large.
Prose pending.
tests/scripts/test_architecture_checker.py
source · 70 tests · 933 lines
Tests for scripts/architecture_checker.py.
| Kind | Name | Line | Description |
|---|---|---|---|
| function | test_get_layer_known_top_level_and_nested_prefix |
48 | |
| function | test_get_layer_unassigned_returns_none |
55 | |
| function | test_get_layer_without_orchestrata_prefix |
59 | |
| function | test_is_protocol_import |
64 | |
| function | test_is_internal_init_reexport_true_and_false_cases |
69 | |
| function | test_check_import_ignores_non_orchestrata_target |
98 | |
| function | test_check_import_ignores_unassigned_modules |
102 | |
| function | test_check_import_allows_init_reexport_even_upward_shaped |
112 | |
| function | test_check_import_flags_upward_import |
123 | |
| function | test_check_import_allows_downward_import |
133 | |
| function | test_check_import_flags_layer3_peer_import |
143 | |
| function | test_check_import_allows_layer3_protocol_import |
153 | |
| function | test_check_import_allows_layer3_same_package_import |
163 | |
| function | test_parse_module_returns_none_for_missing_file |
176 | |
| function | test_parse_module_returns_none_for_syntax_error |
182 | |
| function | test_parse_module_derives_dotted_module_name |
188 | |
| function | test_extract_imports_excludes_type_checking_block |
201 | |
| function | test_extract_imports_excludes_function_scoped_import |
213 | |
| function | test_extract_imports_excludes_bare_class_body_import |
224 | A class-body-level import (not inside any method) is excluded from the |
| function | test_extract_imports_includes_module_level_import_statement |
236 | Covers the ast.Import (bare import x) branch of |
| function | test_extract_imports_ignores_non_orchestrata_imports |
253 | |
| function | test_extract_imports_returns_empty_for_unparseable_file |
261 | |
| function | test_function_scoped_imports_includes_def_nested_import |
270 | |
| function | test_function_scoped_imports_excludes_bare_class_body_import |
286 | A class-body-only import (never nested in a method/def) is NOT |
| function | test_function_scoped_imports_includes_method_nested_import |
298 | A def-nested import inside a method (function inside a class) still |
| function | test_function_scoped_imports_excludes_type_checking |
317 | |
| function | test_function_scoped_imports_returns_empty_for_unparseable_file |
329 | |
| function | test_check_project_counts_violations_files_and_info |
338 | |
| function | test_check_project_waives_known_violation |
362 | The KNOWN_VIOLATIONS entry (cxp.prolog_bridge -> orchestrator.prolog_worker) |
| function | test_check_project_ignores_function_scoped_import_of_unassigned_module |
380 | A def-nested import of a module with no layer assignment (e.g. a |
| function | test_check_project_verbose_prints_violation_lines |
401 | |
| function | test_check_project_skips_pycache |
415 | |
| function | test_check_di_instantiation_flags_outside_home_packages |
440 | |
| function | test_check_di_instantiation_allows_gateway_package |
453 | |
| function | test_check_di_instantiation_allows_plugin_package |
463 | |
| function | test_check_di_instantiation_allows_di_package_itself |
473 | |
| function | test_check_di_instantiation_exempts_test_paths |
482 | |
| function | test_check_di_instantiation_exempts_test_prefixed_filename |
492 | Even outside a literal 'tests' directory, a test_*.py filename is exempt. |
| function | test_check_di_instantiation_ignores_file_without_instantiation |
503 | |
| function | test_check_di_instantiation_detects_attribute_form_call |
513 | A qualified call like container_module.DIContainer() is still caught. |
| function | test_check_di_instantiation_returns_none_for_unparseable_file |
525 | |
| function | test_check_di_instantiation_returns_none_for_missing_file |
531 | |
| function | test_di_container_top_level_package_without_orchestrata_prefix |
537 | A path that never nests under a literal 'orchestrata_ultimate' segment |
| function | test_check_project_verbose_prints_di_violation_line |
546 | |
| function | test_check_project_flags_di_instantiation_violation |
562 | End-to-end: check_project() surfaces the D4 DI-composition violation |
| function | test_check_project_di_instantiation_in_gateway_is_not_a_violation |
581 | |
| function | test_main_reports_missing_path |
601 | |
| function | test_main_writes_output_file |
608 | |
| function | test_main_strict_mode_returns_1_on_violation |
622 | |
| function | test_main_default_run_returns_0_and_prints_info_line |
635 | |
| function | test_subprocess_def_nested_upward_import_is_info_not_violation |
670 | |
| function | test_subprocess_module_level_upward_import_is_violation_not_info |
689 | |
| function | test_subprocess_strict_mode_exit_code_unaffected_by_info_count |
705 | |
| function | test_subprocess_real_codebase_reports_info_line_without_failing |
722 | The INFO line prints with a numeric count and the run still succeeds — |
| function | test_direct_neo4j_driver_construction_flagged |
761 | |
| function | test_direct_async_redis_construction_flagged |
774 | |
| function | test_factory_modules_exempt_from_driver_rule |
785 | |
| function | test_driver_mentions_in_strings_not_flagged |
795 | |
| function | test_factory_calls_not_flagged |
804 | |
| function | test_seam_flags_bare_neo4j_import_outside_allowlist |
817 | |
| function | test_seam_flags_from_neo4j_import |
829 | |
| function | test_seam_flags_session_call |
840 | |
| function | test_seam_allows_probe_import_in_try_import_error |
851 | A bare import neo4j availability probe in try/except ImportError is |
| function | test_seam_probe_exemption_covers_module_not_found_and_tuple |
867 | |
| function | test_seam_from_import_stays_gated_even_in_probe_block |
879 | from neo4j import X binds driver symbols — a try/except wrapper does |
| function | test_seam_session_mention_in_string_not_flagged |
894 | |
| function | test_seam_allowlisted_files_exempt |
904 | |
| function | test_seam_test_paths_exempt |
916 | |
| function | test_seam_unreadable_or_broken_file_is_skipped |
922 | |
| function | test_seam_violation_reaches_check_project |
928 |