Orchestrata Ultimate › Tests › Reference › di
Tests reference — tests/di
tests/di — 1 test modules, 30 test functions. Source tree: tests/di at commit 8a2cb42ad. Generated from the tests AST snapshot by scripts/gen-data-pages.py.
Prose pending.
Modules
| Module | Tests | Covers |
|---|---|---|
test_container_extended.py |
30 | 3 |
Module details
tests/di/test_container_extended.py
source · 30 tests · 907 lines
Extended tests for DI container — edge cases, concurrency, complex chains.
Covers: core.protocols.base, di.container, core.interfaces/ (package)
| Kind | Name | Line | Description |
|---|---|---|---|
| function | test_container_self_registered |
265 | Container registers itself under 'di_container' key. |
| function | test_container_name_and_override |
270 | Container name is set; allow_override defaults to False. |
| function | test_register_returns_self_for_chaining |
285 | register() returns the container for method chaining. |
| function | test_register_instance_returns_self_for_chaining |
291 | register_instance() returns the container for method chaining. |
| function | test_allow_override_replaces_registration |
298 | With allow_override=True, same interface can be re-registered. |
| function | test_config_shallow_copy_isolation |
311 | Mutating original config after register does not affect registration. |
| function | test_factory_with_kwargs_param |
329 | Factory accepting **kwargs receives config via kwargs. |
| function | test_factory_returns_non_icomponent_no_initialize_called |
343 | Non-IComponent factory result does not have initialize() called. |
| function | test_request_scope_without_context_id_uses_default |
356 | REQUEST scope without context_id uses 'default' context_id. |
| function | test_request_scope_with_context_id_no_cache_miss |
363 | REQUEST scope with context_id but no cache hit proceeds to creation. |
| function | test_resolve_missing_dependency_raises_valueerror |
405 | Missing IComponent dependency triggers KeyError caught as ValueError in resolve(). |
| function | test_three_level_dependency_chain |
421 | A -> B -> C dependency chain resolves correctly. |
| function | test_singleton_thread_safe_double_checked_locking |
441 | Multiple threads resolving same singleton get identical instance. |
| function | test_register_with_explicit_dependencies |
473 | Explicit dependencies list overrides auto-extracted dependencies. |
| function | test_shutdown_stops_singleton_instances |
489 | shutdown() calls stop() on IComponent SINGLETONs resolved via |
| function | test_shutdown_stops_singletons_in_reverse_resolution_order |
503 | shutdown() stops SINGLETON components in reverse order of resolution |
| function | test_shutdown_does_not_double_stop_singleton_also_in_context |
524 | A singleton instance that is ALSO manually stashed in _context (e.g. |
| function | test_shutdown_suppresses_error_from_singleton_stop |
566 | shutdown() logs and suppresses a stop() exception from a SINGLETON |
| function | test_builder_with_component_no_matching_config |
582 | with_component when no config key matches results in empty config. |
| function | test_resolution_context_defaults |
606 | ResolutionContext has expected default values. |
| function | test_resolve_with_generic_alias_type |
619 | resolve() strips generic parameters and uses base type. |
| function | test_typed_param_resolved_from_context |
676 | Typed non-IComponent param resolved from container context. |
| function | test_typed_param_uses_default_when_not_in_context |
713 | Typed param with default uses default when not in context or config. |
| function | test_resolve_keyerror_from_missing_transitive_dependency |
783 | Missing transitive dependency raises ValueError via KeyError catch. |
| function | test_resolve_with_context_request_scope_cache_miss |
797 | REQUEST scope cache miss in _resolve_with_context proceeds to creation. |
| function | test_resolve_with_context_singleton_already_cached |
812 | Singleton already in cache returns directly without re-creation. |
| function | test_builder_build_valid_registration |
827 | build() succeeds when all registrations are valid. |
| function | test_get_registry_info_factory_registration |
844 | get_registry_info shows 'factory' for factory-only registrations. |
| function | test_singleton_double_checked_locking_race_branch |
856 | Second concurrent resolver finds singleton already stored at first check. |
| function | test_extract_dependencies_no_icomponent_params |
904 | _extract_dependencies returns empty list when no params are IComponent. |