Skip to content

FU-P11-T1-1: Refactor _FakeWebUIConfig to MagicMock(spec=WebUIConfig)#57

Merged
SoundBlaster merged 6 commits into
mainfrom
feature/FU-P11-T1-1-refactor-fake-webuiconfig-mock
Feb 16, 2026
Merged

FU-P11-T1-1: Refactor _FakeWebUIConfig to MagicMock(spec=WebUIConfig)#57
SoundBlaster merged 6 commits into
mainfrom
feature/FU-P11-T1-1-refactor-fake-webuiconfig-mock

Conversation

@SoundBlaster

Copy link
Copy Markdown
Owner

Description

Replaces two hand-rolled _FakeWebUIConfig inner classes in tests/unit/test_main.py with MagicMock(spec=WebUIConfig). The spec constraint auto-enforces the real WebUIConfig interface, so future property additions no longer require manual stub updates.

Changes:

  • Added from mcpbridge_wrapper.webui.config import WebUIConfig import to test_main.py
  • Removed both _FakeWebUIConfig inner class definitions
  • Replaced each with a MagicMock(spec=WebUIConfig) instance (attributes wired as needed) and a MagicMock(spec=WebUIConfig, return_value=...) class-level mock for patching

Validation report: SPECS/ARCHIVE/FU-P11-T1-1_Refactor_FakeWebUIConfig_to_MagicMock/FU-P11-T1-1_Validation_Report.md

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • CI/CD improvement

Quality Gates

Before submitting, ensure all quality gates pass:

make check

Or run individually:

  • make test - All tests pass with ≥90% coverage
  • make lint - No linting errors
  • make format - Code is properly formatted
  • make typecheck - Type checking passes
  • make doccheck - Documentation is synced with DocC (if docs changed)

Documentation Sync

  • Documentation changes are synced with DocC catalog (or N/A)

Testing

  • Added/updated tests for new functionality
  • All tests pass locally
  • Manually tested the changes

Results: 465 passed, 5 skipped — coverage 95.6% (≥90% required)

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated (if needed)
  • No new warnings generated
  • PR title is descriptive

@SoundBlaster SoundBlaster merged commit 24599f1 into main Feb 16, 2026
9 checks passed
@SoundBlaster SoundBlaster deleted the feature/FU-P11-T1-1-refactor-fake-webuiconfig-mock branch February 16, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant