refactor(app): move imports to module level for better testability
Move internal imports in run_pipeline_mode() to module level to support proper mocking in integration tests. This enables more effective testing of the app's initialization and pipeline setup. Also simplifies the test suite to focus on key integration points. Changes: - Moved effects_plugins, DisplayRegistry, PerformanceMonitor, fetch functions, and pipeline adapters to module-level imports - Removed duplicate imports from run_pipeline_mode() - Simplified test_app.py to focus on core functionality All manual tests still pass (border-test preset works correctly).
This commit is contained in:
@@ -5,13 +5,24 @@ Application orchestrator — pipeline mode entry point.
|
||||
import sys
|
||||
import time
|
||||
|
||||
import effects_plugins
|
||||
from engine import config
|
||||
from engine.display import DisplayRegistry
|
||||
from engine.effects import PerformanceMonitor, get_registry, set_monitor
|
||||
from engine.fetch import fetch_all, fetch_poetry, load_cache
|
||||
from engine.pipeline import (
|
||||
Pipeline,
|
||||
PipelineConfig,
|
||||
get_preset,
|
||||
list_presets,
|
||||
)
|
||||
from engine.pipeline.adapters import (
|
||||
RenderStage,
|
||||
SourceItemsToBufferStage,
|
||||
create_items_stage,
|
||||
create_stage_from_display,
|
||||
create_stage_from_effect,
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -45,18 +56,6 @@ def main():
|
||||
|
||||
def run_pipeline_mode(preset_name: str = "demo"):
|
||||
"""Run using the new unified pipeline architecture."""
|
||||
import effects_plugins
|
||||
from engine.display import DisplayRegistry
|
||||
from engine.effects import PerformanceMonitor, get_registry, set_monitor
|
||||
from engine.fetch import fetch_all, fetch_poetry, load_cache
|
||||
from engine.pipeline.adapters import (
|
||||
RenderStage,
|
||||
SourceItemsToBufferStage,
|
||||
create_items_stage,
|
||||
create_stage_from_display,
|
||||
create_stage_from_effect,
|
||||
)
|
||||
|
||||
print(" \033[1;38;5;46mPIPELINE MODE\033[0m")
|
||||
print(" \033[38;5;245mUsing unified pipeline architecture\033[0m")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user