Private
Public Access
0
0
Files
manual_slop/tests/test_context_composition_phase4.py
T
ed 8f11340b38 refactor(consumers): migrate 85 'from src.models import' sites to direct subsystem imports
Per post_module_taxonomy_de_cruft_20260627 Phase 2 (FR7). Each
'from src.models import X' for a moved class is rewritten to
'from src.<destination> import X':

  Ticket, Track, WorkerContext, TrackState, TrackMetadata,
    ThinkingSegment, EMPTY_TRACK_STATE            -> src.mma
  ProjectContext, ProjectMeta, ProjectOutput, ProjectFiles,
    ProjectScreenshots, ProjectDiscussion, EMPTY_PROJECT_CONTEXT -> src.project
  FileItem, Preset, ContextPreset, ContextFileEntry,
    NamedViewPreset                                -> src.project_files
  Tool, ToolPreset                                 -> src.tool_presets
  BiasProfile                                      -> src.tool_bias
  TextEditorConfig, ExternalEditorConfig,
    EMPTY_TEXT_EDITOR_CONFIG                       -> src.external_editor
  Persona                                          -> src.personas
  WorkspaceProfile                                -> src.workspace_manager
  MCPServerConfig, MCPConfiguration, VectorStoreConfig,
    RAGConfig, load_mcp_config                      -> src.mcp_client

NOT touched (kept on src.models; Phase 3 or Phase 4 will move them):
  GenerateRequest, ConfirmRequest, DEFAULT_TOOL_CATEGORIES, Metadata, PROVIDERS

Migration was performed by the one-time script
scripts/tier2/artifacts/post_module_taxonomy_de_cruft_20260627/migrate_imports.py
which uses a class-to-module map and re.sub() to rewrite each
'from src.models import X' line.

Total: 85 import lines rewritten across 71 files.

Note: this commit depends on the v2 SHIPPED work
(origin/tier2/module_taxonomy_refactor_20260627) being merged into
this branch NEXT. On master (without the v2 SHIPPED commits), the
destination modules do not exist and these imports would fail.
2026-06-26 13:34:03 -04:00

36 lines
1.0 KiB
Python

import pytest
from src.gui_2 import App
from src.project_files import FileItem
def test_view_mode_initialization():
app = App()
# Mock imgui
from imgui_bundle import imgui
app.context_files = [
FileItem(path="test1.py"),
FileItem(path="test2.py", view_mode="full")
]
# We test the model defaults and the rendering assignment logic indirectly.
assert app.context_files[0].view_mode == "full" # Default from FileItem Model
assert app.context_files[1].view_mode == "full"
def test_batch_view_mode_change():
app = App()
f1 = FileItem(path="test1.py", view_mode="full")
f2 = FileItem(path="test2.py", view_mode="full")
app.context_files = [f1, f2]
app.ui_selected_context_files = {"test1.py"}
# Simulate clicking "Skeleton" batch button
for f in app.context_files:
f_path = f.path if hasattr(f, "path") else str(f)
if f_path in app.ui_selected_context_files:
f.view_mode = "skeleton"
assert f1.view_mode == "skeleton"
assert f2.view_mode == "full" # not selected