FU-P11-T1-1: Refactor _FakeWebUIConfig to MagicMock(spec=WebUIConfig)#57
Merged
SoundBlaster merged 6 commits intoFeb 16, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces two hand-rolled
_FakeWebUIConfiginner classes intests/unit/test_main.pywithMagicMock(spec=WebUIConfig). The spec constraint auto-enforces the realWebUIConfiginterface, so future property additions no longer require manual stub updates.Changes:
from mcpbridge_wrapper.webui.config import WebUIConfigimport totest_main.py_FakeWebUIConfiginner class definitionsMagicMock(spec=WebUIConfig)instance (attributes wired as needed) and aMagicMock(spec=WebUIConfig, return_value=...)class-level mock for patchingValidation report:
SPECS/ARCHIVE/FU-P11-T1-1_Refactor_FakeWebUIConfig_to_MagicMock/FU-P11-T1-1_Validation_Report.mdType of Change
Quality Gates
Before submitting, ensure all quality gates pass:
Or run individually:
make test- All tests pass with ≥90% coveragemake lint- No linting errorsmake format- Code is properly formattedmake typecheck- Type checking passesmake doccheck- Documentation is synced with DocC (if docs changed)Documentation Sync
Testing
Results: 465 passed, 5 skipped — coverage 95.6% (≥90% required)
Checklist