forked from SWISDATA/processintel
ui.home: HomeController ignores injected dependencies #23
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: low (injection does not work, which makes the controller hard to test)
Where
app/ui/home_ui/home_controller.py:19-62Problem
The constructor accepts
detection_model,import_model,export_modelandprediction_modeland documents "If None is passed, a new instance is created". It then always creates new instances and ignores the arguments:Tests or extensions that inject mocks silently get the real implementations. The other controllers handle this correctly with
if x is None: x = X().Steps to reproduce
HomeController(detection_model=mock_detection_model)controller.detection_modelExpected behavior
controller.detection_modelis the injected mock.Actual behavior
controller.detection_modelis a newDetectionModelinstance.Fix
Use the same
if x is None: x = X()pattern as the other controllers.from
issues/BUG-023-home-controller-ignores-injected-dependencies.md(code analysis of commit6bcc646, 2026-10-03)